MediaPlayer R3 2016

2 posts, 0 answers
  1. Michel
    Michel avatar
    18 posts
    Member since:
    Sep 2011

    Posted 27 Oct Link to this post

    Setting the Media in the player declaration for playing mp3 is quite easy :

    @(Html.Kendo().MediaPlayer()
    .Name("mediaPlayer")
    .AutoPlay(true)
    .Media(m => m
    .Title("this is my song")
    .Source("sounds/mysong.mp3")            )
    .HtmlAttributes(new { style = "height:360px; width:640px" } )
    )

    But how to change the media source for example if I want to change "mysong.mp3" to "myothersong.mp3" in an event in javascript :

    function onChange(arg)

    {

    $("#mediaPlayer").data("kendoMediaPlayer").media(?????);

    }

    Many thanks

  2. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 01 Nov Link to this post

    Hi Michel,

    Yes, you can change the video source dynamically using the media method of the client-side object of the player widget. Please check the following section and the referenced live demo to see how you can achieve that:
    http://docs.telerik.com/kendo-ui/controls/media/mediaplayer/overview#configuration-Create

    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Telerik UI for ASP.NET Core is out
Back to Top