From 3744e00c8c43a226b6ceededc9ac9f1dea307889 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Thu, 16 Feb 2023 13:25:12 +0800 Subject: [PATCH] feat: video add the isLive property question/163201 --- .../app-plus/view/components/video/index.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/platforms/app-plus/view/components/video/index.vue b/src/platforms/app-plus/view/components/video/index.vue index 374f8ab37f..45b869e74f 100644 --- a/src/platforms/app-plus/view/components/video/index.vue +++ b/src/platforms/app-plus/view/components/video/index.vue @@ -203,6 +203,10 @@ export default { title: { type: String, default: '' + }, + isLive: { + type: Boolean, + default: false } }, computed: { @@ -218,7 +222,13 @@ export default { }, mounted () { this._onParentReady(() => { - const video = this.video = plus.video.createVideoPlayer('video' + Date.now(), Object.assign({}, this.attrs, this.position)) + const playStrategy = Number(this.isLive ? 3 : this.playStrategy) + const video = this.video = plus.video.createVideoPlayer( + 'video' + Date.now(), + Object.assign({}, this.attrs, this.position, { + playStrategy: isNaN(playStrategy) ? 0 : playStrategy + }) + ) plus.webview.currentWebview().append(video) if (this.hidden) { video.hide() -- GitLab