Get reference to IAdaptiveMediaPlugin plugin

Jun 18, 2012 at 2:21 PM
Edited Jun 18, 2012 at 2:24 PM

I have a player declared in an *.xaml file:


<Core:SMFPlayer x:Name="playerSmooth" ...    

I need to get a reference to plugin "IAdaptiveMediaPlugin", in order to se video bitrate range, using function "SetVideoBitrateRange(....)"

I have overloaded MediaPluginRegistered in order to get reference to IAdaptiveMediaPlugin from IMediaPlugin, something like this: 

public IAdaptiveMediaPlugin activeMediaPlugin;

 void playerSmooth_MediaPluginRegistered(object sender, SilverlightMediaFramework.Core.CustomEventArgs<IMediaPlugin > e) {activeMediaPlugin = e as IAdaptiveMediaPlugin;}


But activeMediaPlugin is always set to null. How can I achieve this? Thanks.

















Jun 19, 2012 at 3:37 PM

The MediaPluginRegistered event will return the new MediaPlugin. If you deliverymethod=adaptive and the url is a smooth streaming url, this object is of type IAdaptiveMediaPlugin. For progressive it is IMediaPlugin only. I suspect you may be trying to play progressive content instead of smooth streaming?

Also, to find out more info, you could set a break point and 1) make sure it is hit and 2) check the type of the mediaplugin object passed in.