This is a migrated thread and some comments may be shown as answers.

Pausing Telerik Media player from Javascript

3 Answers 100 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
kalyan
Top achievements
Rank 2
kalyan asked on 21 Jan 2010, 12:13 PM
Hi,

I want to pause the telerik media player from javascript. Please guide me how to achieve this.

Thanks

Kalyan

3 Answers, 1 is accepted

Sort by
0
Vladislav
Telerik team
answered on 25 Jan 2010, 12:16 PM
Hi kalyan,

I am sorry for the delayed reply!

I prepared an example of controlling (Play/Pause) of RadMediaPlayer from JavaScript in the attached solution.
The example is pretty straightforward, but the key points are:
- in "SilverlightApplicationTestPage.aspx" the JS functions (and the buttons invoking them) are defined. The functions locate the Silverlight plug-in and call the corresponding methods in the "MainPage.xaml.cs".
- in "MainPage.xaml.cs" a scriptable object named "SL_SMT" is created during the initialization. In this scriptable object the actual play/pause methods are implemented. Please note the annotation of these methods.

Don't hesitate to ask if you have any further questions.

All the best,
Vladislav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
kalyan
Top achievements
Rank 2
answered on 25 Jan 2010, 12:28 PM

Vladislav ,

Thanks for your reply,I have already achieved this by the  same process applied by you . But i wanted a different type of solution like

ex : http://forums.silverlight.net/forums/p/9481/30268.aspx. I can directly pause the Mediaelement from the javascript directly without calling to the scriptable object. But I can't do this incase of Telerik Media player . If i can get this solution then i have many options with me. Please reply me incase you found a solution.

Thanks

Kalyan

0
Kiril Stanoev
Telerik team
answered on 27 Jan 2010, 01:39 PM
Hi Kalyan,

I am not 100% sure, but this appears to be quite an old thread for Silverlight 1.0. Silverlight 1.0 used JavaScript as code-behind and the solution described in the thread was possible. However, this is not the case with later versions of Silverlight. If you want to call managed code from JavaScript, you will have to follow the approach described by Vladislav. As I said, I am not 100%. Could you please confirm whether you are able to achieve this scenario using Silverlight 3 and its MediaElement? The reason why I am asking is because RadMediaPlayer is a wrapper around Silverlight's MediaElement and if the scenario in question is possible, then there should be no reason why this should not work with RadMediaPlayer. Let me know what's your opinion on the matter.

Kind regards,
Kiril Stanoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
MediaPlayer
Asked by
kalyan
Top achievements
Rank 2
Answers by
Vladislav
Telerik team
kalyan
Top achievements
Rank 2
Kiril Stanoev
Telerik team
Share this question
or