Skip to main content

Configuring Media Sources

info

As of 2023, Samsung states that Tizen TV's are not optimized for .NET applications. Samsung strongly recommends using JS/Web applications instead of C#/.NET applications for TVs. Please check the Lura Player Web SDK

Configuring the media sources for video playback is a crucial first step in ensuring a seamless viewing experience. You should provide the appropriate sources based on device capabilities. Choosing the wrong source can lead to playback failure. Therefore, it's essential to configure the stream sources correctly to ensure smooth playback and prevent frustration for the viewer. By taking the time to properly configure the stream sources, the viewer can fully immerse themselves in the content without any distractions or interruptions.

To configure the media sources of the video in Lura Player, you can use the following configuration.

AttributeTypeRequiredDescription
urlstringyesContent URL
typestringyesMIME type of the content

Here are the supported MIME types:

  • application/dash+xml - For DASH streams
  • video/mp4 - For MP4 videos
Single Media Source
using Lura;
using Lura.Unified;
using Tizen.NUI;

// Initialize player
Window window = Window.Instance;
var player = new Player(window);

// Configure with single media source
var config = new Configuration
{
Content = new ContentConfiguration
{
Media = new List<ContentMedia>
{
new ContentMedia
{
Url = "https://media.example.com/dash.mpd",
Type = MediaMimeType.VideoDash
}
}
}
};

// Set configuration
await player.SetConfig(config);
player.Play();

You can also add multiple media sources, Lura Player will adaptively select the media source based on the platforms capabilities.

Multiple Media Sources
using Lura;
using Lura.Unified;
using Tizen.NUI;

// Initialize player
Window window = Window.Instance;
var player = new Player(window);

// Configure with multiple media sources for adaptive streaming
var config = new Configuration
{
Content = new ContentConfiguration
{
Media = new List<ContentMedia>
{
new ContentMedia
{
Url = "https://media.example.com/dash.mpd",
Type = MediaMimeType.VideoDash,
},
new ContentMedia
{
Url = "https://media.example.com/mp4.mp4",
Type = MediaMimeType.VideoMp4,
}
}
}
};

// Set configuration
await player.SetConfig(config);
player.Play();