videojs中遇到的問題

來源:互聯網
上載者:User

標籤:log   loaded   load   code   logs   cti   支援ie   pre   data-   

1、The element or ID supplied is not valid. (videojs):

報錯時頁面中的代碼順序:js代碼在head部分

<video id="example_video_1" class="video-js"       controls preload="none" width="400" height="300"        poster="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1495886342401&di=af1c695a6acede0df16a3740f6dfec0b&imgtype=0&src=http%3A%2F%2Fatt2.citysbs.com%2Fhangzhou%2F2012%2F03%2F13%2F11%2Fmiddle_112501_kiuuladi_0aebaca9151431903ddb8b31fadc53c0.jpg"        data-setup="{}">        <source src="rtmp://pb-fms.chinanews.com.cn/vod/81913_wsj.mp4" type=‘rtmp/mp4‘/></video>
  <!-- 如果要支援IE8 -->  <script src="ie8/videojs-ie8.js"></script>  <!-- 播放器js -->  <script src="video.js"></script>  <script>      videojs.options.flash.swf = "video-js.swf";      var player = videojs(‘example_video_1‘);     player.ready(function() {        this.play();        this.on(‘ended‘, function() {          videojs.log(‘播放結束了!‘);        });     });  </script>

通過在網上查閱,將js代碼放置在頁面底部後問題消失

Moving your script tag to the end of your page, or add an onLoad handler so it fires after the page has loaded.

參考:https://github.com/matthojo/videojs-Background/issues/7

 

videojs中遇到的問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.