Legacy
The documentation for the Media Player before Rock Mobile version 6 (.NET MAUI).
Inherits from Xamarin.Forms.ContentView
While there are commands that will allow you to start playback of an audio or video file in full-screen mode, usually you want that video embedded on the page. For example, on your message library pages, you might want to display the sermon title, then the video in-line, and then the description of that sermon. This view will allow you to have a video embedded into a page. The video itself can be set to auto-play (use sparingly) or to wait for the user to instruct it to play.
If a video is not set to AutoPlay
then a thumbnail will be displayed. If you specify a ThumbnailSource
for the view, then that image will be used as the thumbnail. Otherwise, the view will attempt to generate a thumbnail by inspecting the stream and using the ThumbnailPosition
property value as the offset into the video to capture a thumbnail. Due to limitations in both iOS and Android, auto-thumbnail generation only works on MP4/M4V files. It will not work on HLS streams (usually having an m3u8
extension).
HLS (.m3u8) streams from the service Resi are not supported on Android due to an issue on their end. If you need support for this, you'll need to utilize another streaming service.
Properties
Watch Map Properties
Examples
This second example shows how to configure the MediaPlayer to save the watch interaction when watching a media element video.
Closed Captioning
The MediaPlayer doesn't have a way to toggle captions on or off, but iOS users can take advantage of the Closed Captions + SDH option that will show them. This is currently found under Settings > Accessibility > Subtitles & Captioning. Some video hosts like Vimeo can auto-generate captions.
For more information, check out Apple's official documentation:
Last updated