123456789101112131415161718192021222324252627282930313233343536 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="IE=edge" >
- <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
- <title>视频播放器</title>
- <link href="https://cdn.yfhl.net/static/video/video-js.css" rel="stylesheet" />
- </head>
- <body style="margin: 0">
- <script src="https://cdn.yfhl.net/static/video/jquery.min.js"></script>
- <script src="https://cdn.yfhl.net/static/video/video.min.js"></script>
- <script src="/player/query.js"></script>
- <script>
- $(function(){
- // 获得播放路径
- const source = getParam('source');
- const url = decodeURIComponent(source);
- // 添加内容
- $('body').append('<video id="my-player" class="video-js">\n' +
- ' <source src="'+url+'" type="video/mp4">\n' +
- '</video>\n');
- // 进行初始化
- videojs('my-player', {
- controls: true,
- autoplay: false,
- preload: 'auto',
- fluid: true
- });
- })
- </script>
- </body>
|