我正在使用kendoMediaPlayer,初始输出的视频播放效果还不错,但我需要更新并上传另一个视频。
我试着先销毁,但它没有工作。
$("#mediaplayer").data("kendoMediaPlayer").destroy();
$("#mediaplayer").kendoMediaPlayer({
autoPlay: true,
navigatable: true,
media: {
title: title,
source: (path)
}
});
我得到了这个错误。
kendo.all.js:204318 Uncaught TypeError: Cannot read property
'removeClass' of undefined
at init._playStateToggle (kendo.all.js:204318)
at init.stop (kendo.all.js:204318)
at init._setPlayerUrl (kendo.all.js:204318)
at init.media (kendo.all.js:204318)
at new init (kendo.all.js:204318)
at HTMLDivElement.<anonymous> (kendo.all.js:204318)
at Function.each (jquery.min.js:2)
at n.fn.init.each (jquery.min.js:2)
at n.fn.init.e.fn.<computed> [as kendoMediaPlayer]
(kendo.all.js:204318)
at PlayVideo (eval at <anonymous> (jquery.min.js:1), <anonymous>:71:31)
if(!$("#mediaplayer").data("kendoMediaPlayer")){
$("#mediaplayer").kendoMediaPlayer({
autoPlay: true,
navigatable: true,
media: {
title: title,
source: (path)
}
});
}
else{
var player = $("#mediaplayer").data("kendoMediaPlayer");
player.media({
title: title,
source: (path)
});
player.play();
}