提交 bf0973fa 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新video示例

上级 b3906d58
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<button type="primary" @click="seek(pos)">跳转到指定位置</button> <button type="primary" @click="seek(pos)">跳转到指定位置</button>
</view> </view>
<view class="uni-btn-v"> <view class="uni-btn-v">
<button type="primary" @click="requestFullScreen(direction)">进入全屏</button> <button type="primary" @click="requestFullScreen(requestFullScreenOptions)">进入全屏</button>
</view> </view>
<view class="uni-btn-v"> <view class="uni-btn-v">
<button type="primary" @click="exitFullScreen">退出全屏</button> <button type="primary" @click="exitFullScreen">退出全屏</button>
...@@ -33,15 +33,6 @@ ...@@ -33,15 +33,6 @@
<view class="uni-btn-v"> <view class="uni-btn-v">
<button type="primary" @click="stop">停止</button> <button type="primary" @click="stop">停止</button>
</view> </view>
<view class="uni-btn-v">
<button type="primary" @click="hide">隐藏</button>
</view>
<view class="uni-btn-v">
<button type="primary" @click="show">显示</button>
</view>
<view class="uni-btn-v">
<button type="primary" @click="close">关闭</button>
</view>
<view class="uni-btn-v"> <view class="uni-btn-v">
<button type="primary" @click="sendDanmu(danmu)">发送弹幕</button> <button type="primary" @click="sendDanmu(danmu)">发送弹幕</button>
</view> </view>
...@@ -137,7 +128,6 @@ ...@@ -137,7 +128,6 @@
</template> </template>
<script lang="uts"> <script lang="uts">
import { VideoNode } from "uts.sdk.modules.DCloudUniVideo";
export default { export default {
onReady() { onReady() {
this.videoContext = uni.createVideoContext('video', this); this.videoContext = uni.createVideoContext('video', this);
...@@ -180,10 +170,9 @@ ...@@ -180,10 +170,9 @@
danmuBtn: false, danmuBtn: false,
enableDanmu: true, enableDanmu: true,
pageGesture: false, pageGesture: false,
direction: { direction: -90,
direction: 0 _direction: 0,
} as RequestFullScreenOptions, requestFullScreenOptions: {
_direction: {
direction: -90 direction: -90
} as RequestFullScreenOptions, } as RequestFullScreenOptions,
showProgress: true, showProgress: true,
...@@ -246,19 +235,7 @@ ...@@ -246,19 +235,7 @@
}, },
stop: function () { stop: function () {
console.log("stop"); console.log("stop");
(this.$refs["video"] as VideoNode).stop(); this.videoContext?.stop();
},
hide: function () {
console.log("hide");
(this.$refs["video"] as VideoNode).hide();
},
show: function () {
console.log("show");
(this.$refs["video"] as VideoNode).show();
},
close: function () {
console.log("close");
(this.$refs["video"] as VideoNode).close();
}, },
sendDanmu: function (danmu : Danmu) { sendDanmu: function (danmu : Danmu) {
console.log("sendDanmu -> " + danmu); console.log("sendDanmu -> " + danmu);
...@@ -305,8 +282,8 @@ ...@@ -305,8 +282,8 @@
this.pageGesture = !this.pageGesture; this.pageGesture = !this.pageGesture;
console.log("pageGesture -> " + this.pageGesture) console.log("pageGesture -> " + this.pageGesture)
}, },
setDirection: function (options : RequestFullScreenOptions) { setDirection: function (direction: number) {
this.direction = options; this.direction = direction;
console.log("direction -> " + this.direction) console.log("direction -> " + this.direction)
}, },
setShowProgress: function () { setShowProgress: function () {
...@@ -417,4 +394,4 @@ ...@@ -417,4 +394,4 @@
width: 750rpx; width: 750rpx;
height: 400rpx; height: 400rpx;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册