Pausing Telerik Media player from Javascript

4 posts, 0 answers
  1. kalyan
    kalyan avatar
    38 posts
    Member since:
    Jul 2008

    Posted 21 Jan 2010 Link to this post

    Hi,

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

    Thanks

    Kalyan
  2. Vladislav
    Admin
    Vladislav avatar
    276 posts

    Posted 25 Jan 2010 Link to this post

    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.
  3. DevCraft banner
  4. kalyan
    kalyan avatar
    38 posts
    Member since:
    Jul 2008

    Posted 25 Jan 2010 Link to this post

    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

  5. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 27 Jan 2010 Link to this post

    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.
Back to Top