问题
Backstory in Silverlight 5 dynamic stream URI setting.
My goal (as an artifact from the link) is to resolve why I'm rendering audio fine but not video for smooth streaming files in dynamically rendered (InitParam) smooth URIs.
Basically, I need to pass a dynamically generated smooth stream URI into the player and set "Media Source" correctly. Which I believe I've done.
Testing statically linked MediaSource="http://playready.directtaps.net/smoothstreaming/TTLSS720VC1/To_The_Limit_720.ism/Manifest"/ works fine for both video and audio. However dynamically generating the PlayListItem doesn't.
The code..
MainPage.xaml
<UserControl x:Class="SilverlightApplicationDPCS.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Core="clr-namespace:Microsoft.SilverlightMediaFramework.Core;assembly=Microsoft.SilverlightMediaFramework.Core"
xmlns:Media="clr-namespace:Microsoft.SilverlightMediaFramework.Core.Media;assembly=Microsoft.SilverlightMediaFramework.Core"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White" xmlns:smf="http://schemas.microsoft.com/smf/2010/xaml/player">
<smf:SMFPlayer HorizontalAlignment="Stretch" Margin="0"
x:Name="sMFPlayer" VerticalAlignment="Stretch" />
<Core:SMFPlayer AutoPlay="True" AutoLoad="True">
<Core:SMFPlayer.Playlist>
</Core:SMFPlayer.Playlist>
</Core:SMFPlayer>
</Grid>
MainPage.xaml.cs (overriding the consumption of the InitParam param for debug purposes statically setting uriString)
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
App currentApp = (App)Application.Current;
string uriString = "http://playready.directtaps.net/smoothstreaming/TTLSS720VC1/To_The_Limit_720.ism/Manifest";
if (sMFPlayer.Playlist.Count > 0)
sMFPlayer.Playlist.Clear();
sMFPlayer.Playlist.Add(new PlaylistItem
{
MediaSource = new Uri(uriString, UriKind.Absolute),
DeliveryMethod = DeliveryMethods.AdaptiveStreaming
});
sMFPlayer.Play();
All references below are version 2.012.0605.0, other than Microsoft.Web.Media.SmoothStreaming.dll version 2.0.157.18
Project References:
Microsoft.SilverlightMediaFramework.Core.dll
Microsoft.SilverlightMediaFramework.Plugins.dll
Microsoft.SilverlightMediaFramework.Plugins.SmoothStreaming.dll
Microsoft.SilverlightMediaFramework.Utilities.dll
Microsoft.Web.Media.SmoothStreaming.dll
Compiler Environment:
Microsoft Media Platform: Player Framework
Silverlight 5
Windows 7
Visual Studio 2015
Browser: Run-time Internet Explorer 11.
Fiddler shows video and audio smooth fragments..
GET http://playready.directtaps.net/smoothstreaming/TTLSS720VC1/To_The_Limit_720.ism/QualityLevels(688000)/Fragments(video=60050000) HTTP/1.1
GET http://playready.directtaps.net/smoothstreaming/TTLSS720VC1/To_The_Limit_720.ism/QualityLevels(128000)/Fragments(audio=61765079) HTTP/1.1
From the above StackOverlow link, where I'm left is:
Why I can't see video from multiple smooth streaming sources in Silverlight 5, nor player controls being operative, but hear audio and see video and audio packets in Fiddler is perplexing.
Grateful for any ideas to fix this.
来源:https://stackoverflow.com/questions/36767344/no-smooth-streaming-video-only-audio-in-code-behind-with-silverlight-5