使用dp.switchVideo方法实现
- <div class="card" style="width:100%;height:60%;margin-top:7.5%;">
- <div id="dplayer" class="background2"></div>
- <script>
- const dp = new DPlayer({
- container: document.getElementById('dplayer'),
- screenshot: true,
- video: {
- url: 'http://static.smartisanos.cn/common/video/t1-ui.mp4',
- pic: 'http://static.smartisanos.cn/pr/img/video/video_03_cc87ce5bdb.jpg',
- thumbnails: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara_thumbnails.jpg'
- }
- })function sw(){
- dp.switchVideo({
- url: 'video/背景.mp4',
- pic: 'http://static.smartisanos.cn/pr/img/video/video_03_cc87ce5bdb.jpg',
- thumbnails: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara_thumbnails.jpg'
- })
- }
- </script>
复制代码
|