How to play video and audio synchronously from different sources?

I have separate video and audio URLs for the same media file, and I want to play audio and video synchronously. How can i do this?

I thought I could use MediaElementit MediaPlayerfor video and audio:

mediaElement.Source = new Uri(videoSourceUrl, UriKind.RelativeOrAbsolute);
mediaPlayer.Source = MediaSource.CreateFromUri(new Uri(audioSourceUrl, 
                                               UriKind.RelativeOrAbsolute));

But the problem is that in one of them there may be a delay in buffering, or the user can change the position so that the video and audio do not match.

Before I stop and start playing and moving around manually, is there an easier way to join audio and video?

+4
source share
1 answer

I believe you can do it with MediaComposition

0

Source: https://habr.com/ru/post/1666530/


All Articles