Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Fix HLS streaming (use AdaptiveMediaSource instead of MediaSource) #8

Merged
merged 1 commit into from
Feb 21, 2017

Conversation

bfreydier
Copy link
Contributor

No description provided.

{
return MediaSource.CreateFromUri(new Uri(streamUrl));
return MediaSource.CreateFromAdaptiveMediaSource(mediaSource);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should only do this for hls content types

@@ -61,7 +65,7 @@ public PlayerViewModel(IGrooveClient grooveClient, GrooveApiErrorViewModel error

if (!string.IsNullOrEmpty(streamResponse.Url))
{
StreamUrl = streamResponse.Url;
MediaSource = (await AdaptiveMediaSource.CreateFromUriAsync(new Uri(streamResponse.Url))).MediaSource;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be interesting to add a comment to explain why this is needed

Copy link
Member

@antoinecellerier antoinecellerier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably need to fix non HLS content playback

MediaSource =
streamResponse.ContentType == "application/vnd.apple.mpegurl"
? MediaSource.CreateFromAdaptiveMediaSource(
(await AdaptiveMediaSource.CreateFromUriAsync(streamResponseUri)).MediaSource)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(await AdaptiveMediaSource.CreateFromUriAsync(streamResponseUri)).MediaSource) [](start = 28, length = 78)

in the sample codes we saw this morning on the interwebs everyone seemed to check if the AdaptiveMediaSource had a success status before passing it to the MediaSource, do you know if that's important?

@daauro
Copy link
Member

daauro commented Feb 21, 2017

:shipit:

}
}

private async Task<MediaSource> GetMediaSource(Uri streamUri, string contentType)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining why this is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@bfreydier bfreydier merged commit 77b60b7 into master Feb 21, 2017
@bfreydier bfreydier mentioned this pull request Feb 21, 2017
@bfreydier bfreydier deleted the fixhlsstreaming branch February 28, 2017 17:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants