简体   繁体   English

在 jQuery 中创建电影自动播放?

[英]Create movie auto-play in jQuery?

<link rel="stylesheet" href="//releases.flowplayer.org/7.0.4/commercial/skin/skin.css">
    <style>

   </style>
   <script src="//code.jquery.com/jquery-1.12.4.min.js"></script>
  <script src="//releases.flowplayer.org/7.0.4/commercial/flowplayer.min.js"></script>
  <script src="//releases.flowplayer.org/hlsjs/flowplayer.hlsjs.min.js"></script> 
  <script>
  flowplayer(function (api) {
    api.on("load", function (e, api, video) {
      $("#vinfo").text(api.engine.engineName + " engine playing " + video.type);
    }); });
  </script>

<div class="flowplayer fixed-controls no-toggle no-time play-button obj"
      style="    width: 85.5%;
    height: 80%;
    margin-left: 7.2%;
    margin-top: 6%;
    z-index: 1000;" data-key="$812975748999788" data-live="true" data-share="false" data-ratio="0.5625"  data-logo="">
      <video autoplay="true" stretch="true">

         <source type="application/x-mpegurl" src="http://live.wmncdn.net/safaritv2/live2.stream/index.m3u8">
      </video>   
   </div>

Hello friends, how can I add this autoplay script?你好朋友,我该如何添加这个自动播放脚本?

I found this script from this conversation 我从这个对话中找到了这个脚本

Honestly, I do not know jQuery, thank you for helping me.老实说,我不知道jQuery,谢谢你帮助我。 I have been working for 6 hours, but I could not.我已经工作了 6 个小时,但我做不到。 :) :)

I give you a sample code for your reference:我给你一个示例代码供你参考:

 $( document ).ready(()=>{ let player= videojs('hls-example', {autoplay:true,controls:true,liveui:true,muted:true}); } );
 <html> <head> <link href="https://vjs.zencdn.net/7.18.1/video-js.css" rel="stylesheet" /> <script src="https://vjs.zencdn.net/7.18.1/video.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body> <video class="video-js vjs-big-play-centered" id='hls-example' width="300" height="200"> <source src="https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8" type="application/x-mpegURL"> </video> </body> </html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM