gpt4 book ai didi

javascript - 类型错误 : 'undefined' is not a function in Safari

转载 作者:搜寻专家 更新时间:2023-10-31 08:18:42 25 4
gpt4 key购买 nike

我尝试开始播放视频,但出现错误

TypeError: 'undefined' is not a function (evaluating '$("video")[0].play()')

但在其他浏览器中一切正常

$('a').bind('click', function() {
$('video')[0].play();
});

<video controls>
<source id="webm" src="/video.webm" type="video/webm" />
<source id="mp4" src="/video.mp4" type='video/mp4'/>
</video>

最佳答案

我不明白为什么现在还没有正确回答这个问题,但这里是:

适用于 Windows 的最新 Safari 版本非常旧(v5 最初于 2010 年发布)并且很可能不支持 html5 视频,因此 $('video')[0] 查找的 DOM 元素 没有 play() 函数。

关于javascript - 类型错误 : 'undefined' is not a function in Safari,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21987074/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com