Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
bf0973fa
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
bf0973fa
编写于
9月 14, 2023
作者:
DCloud-yinjiacheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新video示例
上级
b3906d58
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
31 deletion
+8
-31
pages/component/video/video.uvue
pages/component/video/video.uvue
+8
-31
未找到文件。
pages/component/video/video.uvue
浏览文件 @
bf0973fa
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录