Reputation: 41
When playing any video from YouTube you have no problem, however I have problems trying to play a live video
<Grid Background="Black">
<MediaElement Name="Media"
AreTransportControlsEnabled="True">
</MediaElement>
</Grid>
I am using the package MyToolkit.Extended
public async void SetDataPlayer()
{
_loadAnimationListener?.FinishLoadAnimation();
var videoURL = await YouTube.GetVideoUriAsync("DU5u4oCR8l0", YouTubeQuality.Quality1080P);
Media.Source = videoURL.Uri;
}
Upvotes: 0
Views: 98
Reputation: 32785
How to play a live video on youtube?
You could use CreateFromUri
to converter YouTube video uri to MediaSource
like the follow.
public async void SetDataPlayer()
{
_loadAnimationListener?.FinishLoadAnimation();
var videoURL = await YouTube.GetVideoUriAsync("Bey4XXJxxxxx", YouTubeQuality.Quality1080P);
Media.Source = MediaSource.CreateFromUri(videoURL.Uri);
}
Upvotes: 1