Commit 0b88d760 by Tianqing Liu

feat: 自动播放功能

1 parent 35eb4a57
......@@ -7,6 +7,24 @@ import { watermarkBase64 } from './data';
export default {
name: 'VionPlayer',
props: {
type: {
type: String,
default: 'live', // playback
},
playUrl: {
type: String,
default: '', // 若配置,则播放器加载后,自动播放
},
datetimeRange: {
type: Array,
default: null,
},
watermarkText: {
type: String,
default: '',
},
},
data() {
return {
// eslint-disable-next-line
......@@ -54,6 +72,11 @@ export default {
this._jessibuca = new window.JessibucaPro(options);
this.registerEvent(this._jessibuca);
if (this.playUrl) {
// 示例上有延迟写法
setTimeout(this.play(this.playUrl), 150);
}
},
registerEvent(playerIns) {
playerIns.on("log", msg => {
......
<template>
<div class="j-player-demo">
<div class="player-content">
<!-- :play-url="playUrl" -->
<vion-player ref="vionPlayer"
:type="playerType"
prefix-url=""
player-address="52.130.155.147"
channel-id="20000000001310000008"
:datetime-range="datetimeRange"
watermarkText="方案智能"
/>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!