game/src/components/video-player.wpy
2019-03-27 11:56:08 +08:00

58 lines
1.1 KiB
Plaintext

<style lang="less">
.video-view {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 103;
}
.video-view .video-main {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.video-view .video-main video {
position: absolute;
width: 100%;
height: 100%;
}
</style>
<template>
<view class="video-view {{ config.hide ? 'hidden' : ''}}">
<view class="video-main">
<video
id="video_player"
src=""
controls
autoplay
@play = "videoPlay"
@ended = "videoEnd"
@fullscreenchange = "fullscreenchange"
></video>
</view>
</view>
</template>
<script>
import wepy from 'wepy'
export default class VideoPlayer extends wepy.component {
props = {
config: {
hide: false,
videoUrl: '',
},
}
methods = {
videoPlay: function() {
// wepy.createVideoContext('video_player').requestFullScreen()
},
videoEnd: function() {
this.$emit('videoEnd')
}
};
}
</script>