首页 > 编程知识 正文

aliplayer播放器,vue aliplayer

时间:2023-05-03 07:28:31 阅读:244235 作者:893

initVideo (url) { const self = this self.videoHeight = window.getComputedStyle(this.$refs.container).height if (self.player) { console.log('视频已经存在...') } else { try { self.player = new Aliplayer({ id: self.videoDomId, source: url, width: '100%', height: self.videoHeight, autoplay: true, isLive: true, rePlay: true, playsinline: true, preload: true, // controlBar: false, controlBarVisibility: 'always', //重点!!!!! useH5Prism: true }, function (player) { //先静音然后播放,解决浏览器不能自动播放问题 player.mute(); player.play(); console.log('The player is created') }) } catch (err) { console.warn(err) } } }, <style lang="scss">.video-container { height: 100%; .operators { display: none; }}.prism-live-display, //live.prism-cc-btn, //cc.prism-setting-btn, //设置.volume-icon.mute, //音量图标.prism-fullscreen-btn, //全屏.prism-big-play-btn, //播放按钮.prism-info-display .prism-volume { display: none !important;}.prism-info-display.prism-info-left-bottom{ display: none;}</style> 重点:将 controlBarVisibility设置为’always’,再去修改样式

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。