html播放服务器视频,vue-video-player或者HTML5 video播放服务器视频MP4 报403 浏览器正常播放-汗血宝马...

<template>

<div class="player">

<video-player  class="vjs-custom-skin"

ref="videoPlayer"

:options="playerOptions"

:playsinline="true"

@play="onPlayerPlay($event)"

@pause="onPlayerPause($event)"

@ended="onPlayerEnded($event)"

@loadeddata="onPlayerLoadeddata($event)"

@waiting="onPlayerWaiting($event)"

@playing="onPlayerPlaying($event)"

@timeupdate="onPlayerTimeupdate($event)"

@canplay="onPlayerCanplay($event)"

@canplaythrough="onPlayerCanplaythrough($event)"

@ready="playerReadied"

@statechanged="playerStateChanged($event)">

</video-player>

<video controls="" autoplay="" name="media"><source :src="params.filenamepath" type="video/mp4"></video>

</div>

</template>

<script>

import lessonService from '../lessonService'

export default {

data () {

return {

// videojs options

playerOptions: {

playbackRates: [0.7, 1.0, 1.5, 2.0], // 播放速度

loop: false, // 导致视频一结束就重新开始。

language: 'zh-CN',

height: document.documentElement.clientHeight,

width: document.documentElement.clientWidth,

autoplay: false,

sources: [{

type: 'video/mp4',

src: 'https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm'

}],

poster: 'https://surmon-china.github.io/vue-quill-editor/static/images/surmon-1.jpg'

},

lengthOfTime: 0,

state: 0,

params: {}

}

},

mounted () {

this.params = this.$route.params

this.playerOptions.sources[0].src = this.params.filenamepath

}

}

</script>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值