如何替换现有的kendo mediaplayer中的值?

问题描述 投票:1回答:1

我正在使用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)
kendo-ui
1个回答
0
投票
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();
}
© www.soinside.com 2019 - 2024. All rights reserved.