Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
3f3c3f31
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6007
Star
91
Fork
164
代码
文件
提交
分支
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看板
提交
3f3c3f31
编写于
8月 12, 2024
作者:
DCloud-yinjiacheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新video示例
上级
2117a8ed
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
25 addition
and
0 deletion
+25
-0
pages/component/video/video.uvue
pages/component/video/video.uvue
+25
-0
未找到文件。
pages/component/video/video.uvue
浏览文件 @
3f3c3f31
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
:http-cache="httpCache" :play-strategy="playStrategy" :danmu-list="danmuList" @play="onPlay" @pause="onPause"
:http-cache="httpCache" :play-strategy="playStrategy" :danmu-list="danmuList" @play="onPlay" @pause="onPause"
@ended="onEnded" @timeupdate="onTimeUpdate" @waiting="onWaiting" @error="onError" @progress="onProgress"
@ended="onEnded" @timeupdate="onTimeUpdate" @waiting="onWaiting" @error="onError" @progress="onProgress"
@fullscreenclick="onFullScreenClick" @controlstoggle="onControlsToggle" @fullscreenchange="onFullScreenChange">
@fullscreenclick="onFullScreenClick" @controlstoggle="onControlsToggle" @fullscreenchange="onFullScreenChange">
<!-- #ifdef APP-ANDROID -->
<image class="custom-play-btn" v-if="customPlayBtnEnable" v-show="customPlayBtnShow" src="/static/play.png" @tap="play" />
<!-- #endif -->
</video>
</video>
<scroll-view class="uni-padding-wrap uni-common-mt uni-flex-item">
<scroll-view class="uni-padding-wrap uni-common-mt uni-flex-item">
<view class="uni-btn-v">
<view class="uni-btn-v">
...
@@ -17,6 +20,12 @@
...
@@ -17,6 +20,12 @@
<button type="primary" @click="pause">视频格式示例</button>
<button type="primary" @click="pause">视频格式示例</button>
</navigator>
</navigator>
</view>
</view>
<!-- #ifdef APP-ANDROID -->
<view class="uni-flex uni-btn-v" style="justify-content: space-between;">
<text class="uni-title">中间播放按钮是否替换为子组件</text>
<switch :checked="customPlayBtnEnable" :disabled="!customPlayBtnShow" @change="onCustomPlayBtnEnableChange" />
</view>
<!-- #endif -->
<view class="uni-title">
<view class="uni-title">
<text class="uni-title-text">API示例</text>
<text class="uni-title-text">API示例</text>
</View>
</View>
...
@@ -167,6 +176,8 @@
...
@@ -167,6 +176,8 @@
rate: 1,
rate: 1,
rateItemTypes: [{ "value": 0, "name": "0.5" }, { "value": 1, "name": "0.8" }, { "value": 2, "name": "1.0" }, { "value": 3, "name": "1.25" }, { "value": 4, "name": "1.5" }] as ItemType[],
rateItemTypes: [{ "value": 0, "name": "0.5" }, { "value": 1, "name": "0.8" }, { "value": 2, "name": "1.0" }, { "value": 3, "name": "1.25" }, { "value": 4, "name": "1.5" }] as ItemType[],
rateItems: [0.5, 0.8, 1.0, 1.25, 1.5],
rateItems: [0.5, 0.8, 1.0, 1.25, 1.5],
customPlayBtnEnable: false,
customPlayBtnShow: true,
// 自动化测试
// 自动化测试
autoTest: false,
autoTest: false,
isPlaying: false,
isPlaying: false,
...
@@ -216,6 +227,7 @@
...
@@ -216,6 +227,7 @@
console.log("stop");
console.log("stop");
uni.getElementById<UniVideoElement>("video")?.stop(); //泛型写法测试
uni.getElementById<UniVideoElement>("video")?.stop(); //泛型写法测试
// this.videoContext?.stop();
// this.videoContext?.stop();
this.customPlayBtnShow = true;
},
},
sendDanmu: function () {
sendDanmu: function () {
console.log("sendDanmu -> " + this.danmu);
console.log("sendDanmu -> " + this.danmu);
...
@@ -364,11 +376,15 @@
...
@@ -364,11 +376,15 @@
this.header = json as UTSJSONObject;
this.header = json as UTSJSONObject;
console.log("header -> " + JSON.stringify(this.header))
console.log("header -> " + JSON.stringify(this.header))
},
},
onCustomPlayBtnEnableChange: function (event : UniSwitchChangeEvent) {
this.customPlayBtnEnable = event.detail.value;
},
// 事件
// 事件
onPlay: function (res : UniEvent) {
onPlay: function (res : UniEvent) {
console.log(res.type);
console.log(res.type);
this.isPlaying = true;
this.isPlaying = true;
this.isPause = false;
this.isPause = false;
this.customPlayBtnShow = false;
if (this.autoTest) {
if (this.autoTest) {
this.eventPlay = {
this.eventPlay = {
"tagName": res.target?.tagName,
"tagName": res.target?.tagName,
...
@@ -502,4 +518,13 @@
...
@@ -502,4 +518,13 @@
.margin-10 {
.margin-10 {
margin: 10px;
margin: 10px;
}
}
.custom-play-btn {
width: 60px;
height: 60px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
position: absolute;
}
</style>
</style>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录