完成第一部分
This commit is contained in:
parent
e05425cb40
commit
74f43449b4
41
pages/test/testVideo/testVideo.js
Normal file
41
pages/test/testVideo/testVideo.js
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
Page({
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
videoPlay(){
|
||||||
|
this.videoContext.play()
|
||||||
|
},
|
||||||
|
|
||||||
|
videoPause() {
|
||||||
|
this.videoContext.pause()
|
||||||
|
},
|
||||||
|
|
||||||
|
videoPlayBackRate() {
|
||||||
|
this.videoContext.playbackRate(1.5)
|
||||||
|
},
|
||||||
|
|
||||||
|
videorequestFullScreen() {
|
||||||
|
this.videoContext.requestFullScreen()
|
||||||
|
},
|
||||||
|
|
||||||
|
videoSeek0() {
|
||||||
|
this.videoContext.seek(0)
|
||||||
|
},
|
||||||
|
|
||||||
|
bindInputBlur: function (e) {
|
||||||
|
this.inputValue = e.detail.value
|
||||||
|
},
|
||||||
|
|
||||||
|
bindSendDanmu: function () {
|
||||||
|
this.videoContext.sendDanmu({
|
||||||
|
text: this.inputValue,
|
||||||
|
color:"#FFFFF"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onReady: function () {
|
||||||
|
this.videoContext = wx.createVideoContext('Video')
|
||||||
|
}
|
||||||
|
})
|
3
pages/test/testVideo/testVideo.json
Normal file
3
pages/test/testVideo/testVideo.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
8
pages/test/testVideo/testVideo.wxml
Normal file
8
pages/test/testVideo/testVideo.wxml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<video src="http://1.94.237.210:8848/test.mp4" id="Video" danmu-btn enable-danmu></video>
|
||||||
|
<input placeholder="在这里输入你要发送的弹幕内容" bindblur="bindInputBlur"/>
|
||||||
|
<button type="warn" bindtap="bindSendDanmu">发送弹幕</button>
|
||||||
|
<button type="primary" size="mini" bindtap="videoPlay">播放</button>
|
||||||
|
<button type="primary" size="mini" bindtap="videoPause">暂停</button>
|
||||||
|
<button type="primary" size="mini" bindtap="videoPlayBackRate">1.25倍快进</button>
|
||||||
|
<button type="primary" size="mini" bindtap="videorequestFullScreen">全屏</button>
|
||||||
|
<button type="primary" size="mini" bindtap="videoSeek0">重新播放</button>
|
1
pages/test/testVideo/testVideo.wxss
Normal file
1
pages/test/testVideo/testVideo.wxss
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/* pages/test/testVideo/testVideo.wxss */
|
Loading…
Reference in New Issue
Block a user