- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
两者都在代码中起作用。应该使用哪个?
radio 流会被认为是什么? http://hi5.1980s.fm/ ;
oncanplay
https://jsfiddle.net/vhgL96se/142/
The canplay event is fired when the user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.
The browser can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.
player.oncanplay = function () {
if (value.value !== "") {
canPlay = true;
playPauseIcon(true);
}
};
oncanplaythrough
https://jsfiddle.net/vhgL96se/144/
The canplaythrough event is fired when the user agent can play the media and estimates that enough data has been loaded to play the media up to its end without having to stop for further buffering of content.
The browser estimates it can play the media up to its end without stopping for content buffering.
player.oncanplaythrough = function () {
if (value.value !== "") {
canPlay = true;
playPauseIcon(true);
}
};
最佳答案
您可以使用oncanplay
。但在某些网络浏览器中它并不可靠,因此通常人们会同时使用这两种事件。
因为当 readyState
确实发生变化时会触发这两个事件,您可以使用 player.readyState
来确定当前状态并决定如果事件发生在您设置监听器之前该怎么做.
关于javascript - oncanplay 与 oncanplaythrough,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54101523/
两者都在代码中起作用。应该使用哪个? radio 流会被认为是什么? http://hi5.1980s.fm/ ; oncanplay https://jsfiddle.net/vhgL96se/14
我被告知要同时使用 oncanplay 和 oncanplaythrough 事件,因为 oncanplay 在某些浏览器中可能不可靠: 在我的代码中,我只使用了 oncanplay 事件。如何设置我
我是一名优秀的程序员,十分优秀!