📌  相关文章
📜  Uncaught (in promise) DOMException: 加载失败,因为没有找到支持的源. - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:57.077000             🧑  作者: Mango

代码示例1
var playPromise = document.querySelector('video').play();

// In browsers that don’t yet support this functionality,
// playPromise won’t be defined.
if (playPromise !== undefined) {
  playPromise.then(function() {
    // Automatic playback started!
  }).catch(function(error) {
    // Automatic playback failed.
    // Show a UI element to let the user manually start playback.
  });
}