Accessing MediaElement or SmoothStreamingMediaElement

Oct 4, 2011 at 7:24 PM
Edited Oct 4, 2011 at 7:24 PM

I'm trying to implement Conviva's LivePass in the 2.2 codebase and am currently totally stuck. The problem is that I need to pass either a MediaElement or a SmoothStreamingMediaElement to Conviva as one of the parameters on their object. In 1.2 this was super easy; however, with the additional layers of abstraction via the plugin and interface classes I can't access either of the objects that I need. Is there anyway to access the MediaElement from within the player? I've been working in SMFPlayer.cs in Core and App.xaml in the SmoothStreaming project?

Much Thanks,


Oct 6, 2011 at 10:03 AM
Edited Oct 6, 2011 at 10:03 AM

I think you cau use this way while extending SMFPlayer:

    public class myPlayer : SMFPlayer
        protected override void OnMediaPluginLoaded()

            var mediaToPassToConviva = this.ActiveMediaPlugin.VisualElement;



Oct 6, 2011 at 3:08 PM

I'm streaming from a IIS SmoothStreaming server using default set up. How can I access ActiveMediaPlugin? (or the current active SmoothStreamingMediaElement)  It is now null.
I need to access the SmoothStreamingCache property, so I can set my custom decryption functions.

Grateful for any help :)


Oct 6, 2011 at 3:49 PM

There is a new event introduced in version 2.4 called MediaPluginRegistered that will provide access to the active MediaPlugin when it is created.


Oct 6, 2011 at 4:39 PM

Thanks Angelo, that worked!


Oct 6, 2011 at 9:05 PM

@timgreendield It didn't work :( 

OnMediaPluginLoaded is never fired. Are there any additional settings I need to do?

Oct 6, 2011 at 9:24 PM

@robbanp, The ActiveMediaPlugin is available in the OnMediaOpened() event in SMFPLayer.cs