I want to:
- play videos in my Xamarin Forms app (iOS + Android + UWP)
- follow best practices and use maintained code
- be able to secure my content (subscription based access)
- if possible, style the transport controls to have a the same look and feel as my app
I found multiple ways that are possible, but not sure what is to be advised given my scenario:
- Azure Media player
I found this talk that implied that it is best to use Azure Media Services to transcode your video to different qualities / formats so you can do Adaptive Bitrate Streaming, which means that depending on the quality of the connection and the device type, you will always have the "best possible" video on every type of device with the lowest bandwith usage. According to this talk this requires a "smart player" with the logic to do the switching between quality levels. In the talk the azure media player is mentioned as the go-to video player because it has support for Adaptive Bitrate Streaming (ABS) from azure media services. It does not mention other players with ABS compatibility. The transcoded video in the sample is played with Azure Media Player, which is hosted in a WebView. And since this talk was from 2018 and in a very recent release of Xamarin Forms (5.0) they have removed support for UIWebView and replaced it with WKWebView and I'm not sure if the WebView (and thus the video player) used in the sample is still supported / advised.
- Custom Renderer
The Xamarin Forms documentation has a section "implementing a video player" where they give you a sample video player in the form of a custom renderer. I like that they allow you to style the transport controls yourself. It is not mentioned if this video player has the same "smart switching" like the azure media player.
- Use vimeo
With a paid subscription you can apperently secure the access your content. The styling of the player is limited, but maybe enough for my purposes. They do the content encoding / smart switching in the player for you. You pay a monthly fee, and have a limit on how many video minutes you can add each month, but no other bandwith / storage costs (as far as I can see).
- Quick and dirty (naive?)
I can upload an mp4 to azure blob storage and use the customer renderer sample to playback the video directly from the blob. This however would mean that there is no dynamic switching of video quality on the client and they would always consume "full bandwidth".
I am new to video transcoding / streaming. Am I missing something in my analysis?
I would definitely go with option 2 because:
I would discard the other options because:
WebView
to display a video it's not very friendly from the UX point of view.And by last, check this official sample, is more updated than the docs.
P.D: it's, custom renderer, not customer renderer ;-)