小程序
小游戏
企业微信
微信支付
扫描小程序码分享
- 当前 Bug 的表现
加载视频,点击播放后全屏,设置了左上角一个关闭按钮
点击左上角关闭,退出全屏,调用stop()
再次点击自定义的播放按钮,播放,视频一直loading
尝试过设置seek到0,也设置了initial-time="0",并无效果
附图:
- 预期表现
停止后,视频回到初始播放位置,视频可正常播放
烦请看一下,这是什么情况,谢谢。
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你好,请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
调试的手机信息:
wxml代码:
<
video
id
=
"video"
class
"video-item pos-r"
src
"{{video}}"
style
"opacity:1;border:2px solid #fff;"
bindended
"endedPlay"
bindplay
"palying"
controls
"{{false}}"
initial-time
"{{0}}"
wx:if
>
cover-view
"video-layer-play-btn pos-a {{isPlaying?'d-block':'d-none'}} text-white font-size-12 p-1"
bindtap
"handlePlaying"
cover-image
"/images/icon_play_white.png"
mode
"widthFix"
"d-block full-width"
></
</
"video-layer pos-a full-width full-height {{isPlaying?'d-block':'d-none'}}"
"video-layer-close-btn pos-a {{isPlaying?'d-block':'d-none'}} text-white font-size-16 p-1"
"closePlaying"
>关闭</
Page({
onReady:
function
() {
this
.videoCtx = wx.createVideoContext(
);
},
/**
* 开始播放
*/
palying:
(e) {
let that =
that.videoCtx.requestFullScreen()
that.videoCtx.hideStatusBar()
that.setData({
isPlaying:
true
,
})
* 手动播放
handlePlaying() {
that.videoCtx.play()
* 关闭观看视频
closePlaying:
that.videoCtx.exitFullScreen()
that.videoCtx.stop()
noEndedPlay:
false
抱歉,请按照教程提供代码片段
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你好,请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
调试的手机信息:
wxml代码:
<
video
id
=
"video"
class
=
"video-item pos-r"
src
=
"{{video}}"
style
=
"opacity:1;border:2px solid #fff;"
bindended
=
"endedPlay"
bindplay
=
"palying"
controls
=
"{{false}}"
initial-time
=
"{{0}}"
wx:if
=
"{{video}}"
>
<
cover-view
class
=
"video-layer-play-btn pos-a {{isPlaying?'d-block':'d-none'}} text-white font-size-12 p-1"
bindtap
=
"handlePlaying"
>
<
cover-image
src
=
"/images/icon_play_white.png"
mode
=
"widthFix"
class
=
"d-block full-width"
></
cover-image
>
</
cover-view
>
<
cover-view
class
=
"video-layer pos-a full-width full-height {{isPlaying?'d-block':'d-none'}}"
>
<
cover-view
class
=
"video-layer-close-btn pos-a {{isPlaying?'d-block':'d-none'}} text-white font-size-16 p-1"
bindtap
=
"closePlaying"
>关闭</
cover-view
>
</
cover-view
>
</
video
>
Page({
onReady:
function
() {
this
.videoCtx = wx.createVideoContext(
"video"
);
},
/**
* 开始播放
*/
palying:
function
(e) {
let that =
this
that.videoCtx.requestFullScreen()
that.videoCtx.hideStatusBar()
that.setData({
isPlaying:
true
,
})
},
/**
* 手动播放
*/
handlePlaying() {
let that =
this
that.videoCtx.play()
that.videoCtx.requestFullScreen()
that.videoCtx.hideStatusBar()
that.setData({
isPlaying:
true
,
})
},
/**
* 关闭观看视频
*/
closePlaying:
function
() {
let that =
this
that.videoCtx.exitFullScreen()
that.videoCtx.stop()
that.setData({
noEndedPlay:
true
,
isPlaying:
false
,
})
},
})
抱歉,请按照教程提供代码片段