This topic describes how your application can play streaming and DRM-protected media content using TV-specific features in the Tizen.TV.Multimedia.Player class.
Tizen.Multimedia.MediaUriSource Class
Tizen.Multimedia.Player Class
Media Playback
You can implement streaming and DRM-protected media playback in your TV .NET application. For information on implementing basic media playback functionality, see Media Playback.
The Tizen.TV.Multimedia.Player class is derived from the Tizen.Multimedia.Player class. In addition to the Tizen.Multimedia.Player class features, you can implement adaptive streaming in the MPEG-DASH and Smooth Streaming formats, and play media protected using PlayReady DRM. For more information on the supported video formats, see Media Specifications > Video.
Tizen.TV.Multimedia.Player
Tizen.Multimedia.Player
Within the Tizen.TV.Multimedia.Player class, support for the Tizen.Multimedia.Player class features has the following limitations:
CaptureVideoAsync()
ApplyAudioStreamPolicy()
AudioEffect()
VideoFrameDecoded
SetPlaybackRate()
To enable your application to use the TV-specific media playback functionalities:
Include the Tizen.TV.Multimedia namespace in your application:
Tizen.TV.Multimedia
using Tizen.TV.Multimedia;
To play media from various sources using the Tizen.Multimedia.MediaUriSource class, the application has to request permission by adding the applicable privileges to the "tizen-manifest.xml" file:
<privileges> <!--To stream media from the network--> <privilege>http://tizen.org/privilege/internet</privilege> <!--To play media from internal storage--> <privilege>http://tizen.org/privilege/mediastorage</privilege> <!--To play media from external storage--> <privilege>http://tizen.org/privilege/externalstorage</privilege> </privileges>
To play DRM-protected content, the application has to request permission by adding the following privilege to the "tizen-manifest.xml" file:
<privileges> <privilege>http://developer.samsung.com/privilege/drmplay</privilege> </privileges>
To play MPEG-DASH or Smooth Streaming content:
Create and initialize the player using an instance of the Tizen.TV.Multimedia.Player class.
To play the media, specify the stream URL as the media source:
player.Source = new MediaUriSource("http://somewhere.com/your_content");
To play content protected with PlayReady DRM:
Create an instance of the DRMManager class, and initialize it with the ApplicationID property of the Tizen.Applications.AppControl class:
DRMManager
ApplicationID
DRMManager drmMgr = DRMManager.CreateDRMManager(DRMType.Playready); drmMgr.Init($"applicationID");
To receive notifications, add event handlers to the appropriate events of the Tizen.TV.Multimedia.Player class.
To play the media:
After setting the media source URL, configure the DRM properties. Set the license server and media source URLs in the DRMManager instance:
String videoUrl = "http://somewhere.com/your_content"; String licenseServerUrl = "http://somewhere.com/your_license"; player.Source = new MediaUriSource(videoUrl); drmMgr.AddProperty("LicenseServer", licenseServerUrl); drmMgr.Url = videoUrl; drmMgr.Open();
Before preparing the player for playback, attach the DRMManager instance to the player:
player.SetDrm(drmMgr); await player.PrepareAsync()
When you no longer need the player, you must release it and the DRMManager instance:
player.Stop(); player.Unprepare(); player.Dispose(); drmMgr.Close(); drmMgr.Dispose();