Commit 1d0747d1 authored by miaojiale's avatar miaojiale

修改一些配置

parent ce3c4a81
...@@ -168,7 +168,13 @@ export default { ...@@ -168,7 +168,13 @@ export default {
this.describe = data this.describe = data
}, },
showVideo (url) { showVideo (url) {
var isIphone = navigator.userAgent.indexOf('iPhone') >= 0;
// if (isIphone) {
// window.open('https://inno.sh-sict.com/gastric-api/gastric-cancer-data/file/show?videoName=' + url, '_self')
// } else {
this.$router.push(`/videoShow?src=${url}`) this.$router.push(`/videoShow?src=${url}`)
// }
}, },
afterRead (file) { afterRead (file) {
this.uploadLoading = true this.uploadLoading = true
......
...@@ -8,16 +8,37 @@ ...@@ -8,16 +8,37 @@
/> />
</div> </div>
<div class="video"> <div class="video">
<!-- <video
id="video"
controls
preload="auto"
loop="loop"
x5-video-player-fullscreen="true"
x5-video-orientation="portraint"
playsinline="true"
x5-video-player-type="h5"
style="object-fit:fill"
>
<source :src="src">
</video> -->
<video <video
ref="videoPlayer" ref="videoPlayer"
class="video-js" class="video-js"
id="videoplayer" id="videoplayer"
></video> playsinline="true"
preload="none"
x5-video-player-type="h5"
x-webkit-airplay="true"
webkit-playsinline="true"
>
</video>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import videojs from 'video.js'; import videojs from 'video.js';
export default { export default {
data () { data () {
return { return {
...@@ -26,18 +47,28 @@ export default { ...@@ -26,18 +47,28 @@ export default {
}, },
computed: { computed: {
src () { src () {
return this.$route.query.src return 'https://inno.sh-sict.com/gastric-api/gastric-cancer-data/file/show?videoName=' + this.$route.query.src
} }
}, },
methods: { methods: {
// 实例化播放器 // 实例化播放器
createVideo () { createVideo () {
let options = { let options = {
width: this.width,
autoplay: false, autoplay: false,
controls: true, controls: true,
sources: [ sources: [
{ {
src: 'https://inno.sh-sict.com/gastric-api/gastric-cancer-data/file/show?videoName=' + this.src, src: this.src,
type: "video/mp4",
},
{
src: this.src,
type: "video/ogg",
},
{
src: this.src,
type: "video/webm",
} }
] ]
} }
...@@ -50,9 +81,18 @@ export default { ...@@ -50,9 +81,18 @@ export default {
} }
}, },
mounted () { mounted () {
videojs.addLanguage('zh-CN', {
"You aborted the media playback": "视频播放被终止",
"A network error caused the media download to fail part-way.": "网络错误导致视频下载中途失败。",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "视频因格式不支持或者服务器或网络的问题无法加载。请尝试使用uc浏览器或qq浏览器。",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。",
"No compatible source was found for this media.": "无法找到此视频兼容的源。",
});
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => {
this.createVideo() this.createVideo()
}) })
})
this.$once('hook:beforeDestroy', () => { this.$once('hook:beforeDestroy', () => {
this.player.dispose(); this.player.dispose();
}) })
......
...@@ -65,7 +65,7 @@ module.exports = { ...@@ -65,7 +65,7 @@ module.exports = {
// change xxx-api/login => mock/login // change xxx-api/login => mock/login
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
"/": { "/": {
target: "http://10.130.2.52:8201", target: "http://10.130.2.64:8201",
changeOrigin: true changeOrigin: 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