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

更新video示例

上级 5b345817
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<view v-for="(item,index) in supportFormats" :key="index"> <view v-for="(item,index) in supportFormats" :key="index">
<text class="uni-subtitle-text">{{item.format}}</text> <text class="uni-subtitle-text">{{item.format}}</text>
<video :id="'video-' + item.format" class="video" :src="item.src" :controls="true" :direction="-90" <video :id="'video-' + item.format" class="video" :src="item.src" :controls="true" :direction="-90"
@error="onError(item.format, $event as VideoErrorEvent)"></video> @error="onError(item.format, $event as UniVideoErrorEvent)"></video>
</view> </view>
<view class="uni-title"> <view class="uni-title">
<text class="uni-title-text">暂不支持的格式</text> <text class="uni-title-text">暂不支持的格式</text>
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
} }
}, },
methods: { methods: {
onError: function (format : string, e : VideoErrorEvent) { onError: function (format : string, e : UniVideoErrorEvent) {
console.log(format + ":" + JSON.stringify(e)); console.log(format + ":" + JSON.stringify(e));
if (format != "错误路径") { if (format != "错误路径") {
this.isError = true; this.isError = true;
......
...@@ -373,39 +373,39 @@ ...@@ -373,39 +373,39 @@
console.log("header -> " + this.header) console.log("header -> " + this.header)
}, },
// 事件 // 事件
onPlay: function (res : Event) { onPlay: function (res : UniEvent) {
console.log(res.type); console.log(res.type);
this.isPlaying = true; this.isPlaying = true;
this.isPause = false; this.isPause = false;
}, },
onPause: function (res : Event) { onPause: function (res : UniEvent) {
console.log(res.type); console.log(res.type);
this.isPlaying = false; this.isPlaying = false;
this.isPause = true; this.isPause = true;
}, },
onEnded: function (res : Event) { onEnded: function (res : UniEvent) {
console.log(res.type); console.log(res.type);
}, },
onTimeUpdate: function (res : VideoTimeUpdateEvent) { onTimeUpdate: function (res : UniVideoTimeUpdateEvent) {
console.log(res.type + " -> " + JSON.stringify(res.detail)); console.log(res.type + " -> " + JSON.stringify(res.detail));
}, },
onFullScreenChange: function (res : VideoFullScreenChangeEvent) { onFullScreenChange: function (res : UniVideoFullScreenChangeEvent) {
console.log(res.type + " -> " + JSON.stringify(res.detail)); console.log(res.type + " -> " + JSON.stringify(res.detail));
this.isFullScreen = !this.isFullScreen; this.isFullScreen = !this.isFullScreen;
}, },
onWaiting: function (res : Event) { onWaiting: function (res : UniEvent) {
console.log(res.type); console.log(res.type);
}, },
onError: function (res : VideoErrorEvent) { onError: function (res : UniVideoErrorEvent) {
console.log(res.type + " -> " + JSON.stringify(res.detail)); console.log(res.type + " -> " + JSON.stringify(res.detail));
}, },
onProgress: function (res : VideoProgressEvent) { onProgress: function (res : UniVideoProgressEvent) {
console.log(res.type + " -> " + JSON.stringify(res.detail)); console.log(res.type + " -> " + JSON.stringify(res.detail));
}, },
onFullScreenClick: function (res : VideoFullScreenClickEvent) { onFullScreenClick: function (res : UniVideoFullScreenClickEvent) {
console.log(res.type + " -> " + JSON.stringify(res.detail)); console.log(res.type + " -> " + JSON.stringify(res.detail));
}, },
onControlsToggle: function (res : VideoControlsToggleEvent) { onControlsToggle: function (res : UniVideoControlsToggleEvent) {
console.log(res.type + " -> " + JSON.stringify(res.detail)); console.log(res.type + " -> " + JSON.stringify(res.detail));
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册