一、文档上提供的接口不生效:
ios手机上无法停止播放,代码如下:
onReady() { this .playerContext = wx.createLivePlayerContext( 'myLive' ); }, handleStop() { if ( this .data.isPlay) { this .playerContext.stop({ success(){ console.log( "stop success!" ); }, fail(){ console.log( "stop fail!" ); } }); } } |
手机调试无法打印stop success!和stop fail!
stop接口执行了但也无法打印成功失败的语句,
在安卓手机上也会偶尔出现无法停止播放的情况。
二、实测live-player标签上catchtap点击事件在 IOS不生效:
安卓机上能生效
三、全屏后点击退出全屏,出现样式错乱:
包括video组件也是这样,css就是使用了基本的flex布局,错乱时需触发一下其他事件才能恢复,比如此时点击一下vConsole,错乱现象就恢复正常了。
你好,问题已复现,我们会尽快进行修复。
1、修复包这两天会发
2、live-player等原生组件暂不支持tap事件
3、麻烦提供个demo测试一下
麻烦提供一下机型。另外在其他机型也有这个问题不?
直播 组队抽奖活动,用户加入组队时, toast提示“未授权信息,加入队伍失败”,导致用户无法参与抽奖。
这个是哪里的问题?!急急急,谢谢
我现在还有这个问题,全屏后退出全屏,样式错乱。并且,全屏时点击暂停,退出全屏时,画面会黑屏。请问你们解决了吗?
@官方 请问无法停止播放的问题解决了吗?什么时候放新包?
测试用图
@黄 希望贵方测试下2楼的四项,特提供完整的测试代码如下:
livePlayer.js:
Page({
data: {
//测试
urlMain:
"rtmp://live.hkstv.hk.lxdns.com/live/hks"
,
urlAssist:
"rtmp://v1.one-tv.com/live/mpegts.stream"
,
isPlay:
true
,
isUrlMain:
true
,
isFullscreen:
false
,
isBarShow:
true
},
onReady(){
this
.playerContext = wx.createLivePlayerContext(
'myLive'
);
},
onFullscreenChange() {
this
.setData({ isFullscreen: !
this
.data.isFullscreen });
},
handlePlayStop() {
if
(
this
.data.isPlay) {
this
.playerContext.stop({
success:
function
() {
console.log(
'stop success!'
)
},
fail:
function
() {
console.log(
'stop failed!'
)
}
});
this
.setData({ isPlay:
false
});
}
else
{
this
.playerContext.play();
this
.setData({ isPlay:
true
});
}
},
handlePlay() {
this
.playerContext.play();
this
.setData({ isPlay:
true
});
},
handleMainAssist() {
if
(
this
.data.isUrlMain) {
this
.setData({isUrlMain:
false
});
}
else
{
this
.setData({ isUrlMain:
true
});
}
},
handleRequestFullScreen() {
this
.playerContext.requestFullScreen({ direction: 90 });
},
handleExitFullScreen() {
this
.playerContext.exitFullScreen();
},
handleBarShow() {
this
.setData({ isBarShow: !
this
.data.isBarShow });
},
keepBarShow() {
this
.setData({ isBarShow:
true
});
},
})
livePlayer.wxml:
<
view
class
=
'live-box'
>
<
live-player
class
=
"live-player"
id
=
"myLive"
bindstatechange
=
"onPlayChange"
bindfullscreenchange
=
"onFullscreenChange"
src
=
"{{isUrlMain?urlMain:urlAssist}}"
mode
=
"live"
autoplay
=
"{{isPlay}}"
background-mute
=
"{{true}}"
object-fit
=
"fillCrop"
>
<
cover-view
class
=
"cover-box"
catchtap
=
"handleBarShow"
>
<
cover-image
class
=
"cover-key-center"
wx:if
=
"{{!isPlay}}"
catchtap
=
"handlePlay"
src
=
"/images/livePlayer/play-center.png"
/>
<
cover-view
class
=
"cover-key"
wx:if
=
"{{isFullscreen && isBarShow}}"
catchtap
=
"keepBarShow"
>
<
cover-view
class
=
"cover-key1"
catchtap
=
"handlePlayStop"
>
<
cover-image
wx:if
=
"{{isPlay}}"
src
=
"/images/livePlayer/stop.png"
/>
<
cover-image
wx:else
src
=
"/images/livePlayer/play.png"
/>
</
cover-view
>
<
cover-view
class
=
"cover-key3"
wx:if
=
"{{urlAssist}}"
catchtap
=
"handleMainAssist"
>
<
cover-view
wx:if
=
"{{isUrlMain}}"
>主流</
cover-view
>
<
cover-view
wx:else>辅流</
cover-view
>
</
cover-view
>
<
cover-image
class
=
"cover-key5"
catchtap
=
"handleExitFullScreen"
src
=
"/images/livePlayer/full-screen-exit.png"
/>
</
cover-view
>
</
cover-view
>
</
live-player
>
<
view
class
=
"live-key"
wx:if
=
"{{!isFullscreen}}"
>
<
view
class
=
"key1"
catchtap
=
"handlePlayStop"
>
<
image
wx:if
=
"{{isPlay}}"
src
=
"/images/livePlayer/stop.png"
/>
<
image
wx:else
src
=
"/images/livePlayer/play.png"
/>
</
view
>
<
view
class
=
"key3"
catchtap
=
"handleMainAssist"
>
<
text
wx:if
=
"{{isUrlMain}}"
>主流</
text
>
<
text
wx:else>辅流</
text
>
</
view
>
<
image
class
=
"key5"
catchtap
=
"handleRequestFullScreen"
src
=
"/images/livePlayer/full-screen.png"
/>
</
view
>
</
view
>
livePlayer.wxss:
.live-box {
width
:
100
vw;
height
:
100
vh;
background
:
#000
;
display
: flex;
flex-
direction
: column;
align-items:
center
;
}
.live-player {
margin-top
:
106
rpx;
width
:
100%
;
height
:
422
rpx;
display
: flex;
flex-
direction
: column;
justify-
content
:
center
;
}
.live-player .cover-box {
width
:
100%
;
height
:
100%
;
position
:
relative
;
}
.live-player .cover-box .cover-key-
center
{
width
:
160
rpx;
height
:
160
rpx;
position
:
absolute
;
left
:
50%
;
margin-left
:
-80
rpx;
top
:
50%
;
margin-top
:
-80
rpx;
}
.live-player .cover-box .loading-img {
width
:
408
rpx;
height
:
320
rpx;
position
:
absolute
;
left
:
50%
;
margin-left
:
-204
rpx;
top
:
50%
;
margin-top
:
-160
rpx;
}
.live-player .cover-box .cover-key {
width
:
1310
rpx;
height
:
94
rpx;
border-radius:
20
rpx;
background
: rgba(
67
,
68
,
71
,
0.70
);
background
: rgba(
34
,
34
,
34
,
0.80
);
background
: rgba(
0
,
0
,
0
,
0.70
);
position
:
absolute
;
left
:
50%
;
margin-left
:
-655
rpx;
bottom
:
0
;
}
.live-player .cover-box .cover-key .cover-key
1
{
width
:
48
rpx;
height
:
48
rpx;
position
:
absolute
;
left
:
4%
;
top
:
50%
;
margin-top
:
-24
rpx;
}
.live-player .cover-box .cover-key .cover-key
1
cover-image {
width
:
100%
;
height
:
100%
;
}
.live-player .cover-box .cover-key .cover-key
3
{
width
:
120
rpx;
height
:
56
rpx;
border
:
2
rpx
solid
#fff
;
border-radius:
200
rpx;
text-align
:
center
;
position
:
absolute
;
left
:
71%
;
top
:
50%
;
margin-top
:
-28
rpx;
}
.live-player .cover-box .cover-key .cover-key
3
cover-view {
line-height
:
56
rpx;
font-family
: PingFangSC-Regular;
font-size
:
28
rpx;
color
:
#fff
;
}
.live-player .cover-box .cover-key .cover-key
5
{
width
:
48
rpx;
height
:
48
rpx;
position
:
absolute
;
left
:
93%
;
top
:
50%
;
margin-top
:
-24
rpx;
}
.live-box .live-key {
margin-top
:
416
rpx;
width
:
650
rpx;
height
:
200
rpx;
background
:
#2b2b2b
;
color
:
#fff
;
border-radius:
20
rpx;
display
: flex;
flex-
direction
: row;
align-items:
center
;
justify-
content
: space-around;
}
.live-box .live-key .key
1
{
width
:
52
rpx;
height
:
52
rpx;
}
.live-box .live-key .key
1
image {
width
:
100%
;
height
:
100%
;
}
.live-box .live-key .key
3
{
width
:
120
rpx;
height
:
56
rpx;
border
:
2
rpx
solid
#fff
;
border-radius:
200
rpx;
text-align
:
center
;
}
.live-box .live-key .key
3
text {
line-height
:
56
rpx;
font-family
: PingFangSC-Regular;
font-size
:
28
rpx;
color
:
#fff
;
}
.live-box .live-key .key
5
{
width
:
52
rpx;
height
:
52
rpx;
}
.toast-content-box .toast-content {
position
:
absolute
;
top
:
550
rpx;
left
:
50
vw;
margin-left
:
-28
vw;
}
livePlayer.json:
{
"navigationBarBackgroundColor"
:
"#000"
,
"navigationBarTextStyle"
:
"white"
,
"backgroundColor"
:
"#000"
,
"disableScroll"
:
true
}
用到的5张图片images/livePlayer:(前四个图片为白色,黑色背景下可以看到)
这个为何审核不通过呢,是测试了未复现这些问题么?