Commit 7a3e0652 authored by xiabin's avatar xiabin

修改视频自适应

parent f267b57c
......@@ -35,11 +35,4 @@ $this->registerJs($js);
</div>
<div class="xs-show-bg"></div>
<script type='text/javascript'>
$(function () {
var wVideo = $('.video-detail-info').width();
$('#my-video-play').css('width',wVideo);
})
</script>
<div class="copyright">© 2016 c.pp.cc 皖ICP备13046642号</div>
cGnhDtidLEiMVuZg
\ No newline at end of file
......@@ -9,7 +9,7 @@
</div>
</div>
<div class="video-main">
<div v-show="videoShow" class="video-main">
<video id="my-video-play" class="video-js vjs-default-skin vjs-big-play-centered"
controls preload="auto">
<source :src="coursewareInfo.videoUrl" type="video/mp4"/>
......@@ -108,8 +108,6 @@
</div>
</div>
</div>
</template>
<script>
......@@ -127,7 +125,8 @@
weixinCheckHandler: false,
reload: false,
isMobile: false,
isWeixin: false
isWeixin: false,
videoShow: false
}
},
watch: {
......@@ -245,20 +244,27 @@
},
components: {},
ready(){
var self = this;
this.isMobile = this.coursewareInfo.isMobile;
this.isWeixin = Utils.isWeixin();
videojs("my-video-play", {
"controls": true,
"autoplay": false,
"language": "zh-CN",
"width": 640,
"height": 264,
poster: this.coursewareInfo.previewUrl
}).ready(function () {
var myPlayer = this;
// EXAMPLE: Start playing the video.
// myPlayer.play();
var rate = 9 / 16;
$('#my-video-play').css('width', '100%');
var wVideo = $('.video-detail-info').width();
var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo);
window.onresize = function () {
var wVideo = $('.video-detail-info').width();
var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo);
};
self.videoShow = true;
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment