Loading plug-in using the code

Jul 20, 2010 at 8:29 PM
Edited Jul 20, 2010 at 8:33 PM
Hello, Sorry if ask a question that was already answered (I have checked previous discussions, but did find an answer, or overlooked it). I wonder how it is possible to load media plugin using the code. E.g. I want to load ProgressiveDownload plug-in into the ActiveMediaPlugin property, will the code below work? this.ActiveMediaPlugin = new ProgressiveMediaPlugIn(); this.ActiveMediaPlugin.Load(); ... The reason I ask is that I get exceptions in logging console: http://tinypic.com/r/35li2dl/3 Plug-in seems to load, but video does not play. I wonder if it can't be played because of the plugin was not loaded correctly, or because this video is incomplete (I have used WebClient to download only part of the original file. WMP can play this file ok as well as simple SL Media Element). Please let me know. Thank you in advance. P.S. Sorry that my post is not formated, something is wrong with WYSIWYG editor on the page :|
Coordinator
Jul 20, 2010 at 11:33 PM

Qch, I do not recommend attempting to set the ActiveMediaPlugin directly.  If you want to be certain that a specific media plugin is loaded, the easy way is to make sure that it's the only one available in your XAP.  For more information about how the media plugin process works, I take a look at this thread: http://smf.codeplex.com/Thread/View.aspx?ThreadId=218739

Jul 20, 2010 at 11:42 PM
Thank you krohlig. The idea here is to load plugin using the code and the try to pass the source from the OpenFileDialog for example, into the SetSource method of the mediaElement. So... basically I wanted to ask your opinion for a best way to do that (load the plugin). If it is even possible :) Thank you very much.
Coordinator
Jul 21, 2010 at 7:55 PM

Qch, Are you setting the source to a Stream?

Jul 21, 2010 at 8:16 PM

Hello krohling,

Yes, after getting the stream from, for example SaveDialog or OpenDialog it is possible to pass it into the mediaElement's SetSource method to make it play. But I'm unable to do so before I load any media plug-ins because I will get a null exception if I'll try to use ActiveMediaPlugin property (since no media plug-ins yet loaded). I wonder if it is possible to load media plug-in (ProgressiveDownload one in my case) when I need it using the code, something simple?

Thank you.

Coordinator
Jul 21, 2010 at 9:49 PM

Qch, We've had a number of requests for SMF to support SetSource(Stream) http://smf.codeplex.com/workitem/17760

This feature will be available very soon in our next release.

Jul 21, 2010 at 9:57 PM

Ok, but that is not really the problem :) what I want to find out is if there's a way to load plug-ins on demand (I mean w/o loading files into playlist and playing play, but something similar to the code in my first post)? E.g. what code should I use to load ProgressiveDownload plug-in and then be able to use ActiveMediaPlugin property of the player?

Thank you very much.

Aug 2, 2010 at 6:57 PM

Hello krohling,

 

Please let me know if you have anything for me regarding this one.

 

Thank you very much.