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

MediaPlayer R3 2016

1 Answer 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michel
Top achievements
Rank 1
Michel asked on 27 Oct 2016, 04:58 PM

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

1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 01 Nov 2016, 11:28 AM
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
Tags
General Discussions
Asked by
Michel
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or