javascript Video.js 重用 ID - destroy()

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16526119/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 05:00:50  来源:igfitidea点击:

Video.js reuse ID - destroy()

javascripthtml5-videovideo.js

提问by bradley

I'm retrieving my video source using ajax. All works fine unless I try to retrieve and play the same video twice.

我正在使用 ajax 检索我的视频源。除非我尝试检索并播放相同的视频两次,否则一切正常。

http://jsfiddle.net/w3JPB/3/

http://jsfiddle.net/w3JPB/3/

You will notice that the second time you click "add" video.js doesn't work and the plain default html5 video player is shown.

您会注意到第二次单击“添加”video.js 不起作用,并且显示了普通的默认 html5 视频播放器。

It seems like I need to destroy the old video object but method described heregives me an error saying "object has no method destroy".

似乎我需要销毁旧的视频对象,但是这里描述的方法给了我一个错误,说“对象没有销毁方法”。

_V_('video1').destroy()

_V_('video1').destroy()

回答by mente

Latest video.js version exposes disposemethod instead. Check your updated example. Working fine for me.

最新的 video.js 版本dispose改为公开方法。检查您更新的示例。对我来说工作得很好。