VXG pnacl下nmf引用失效问题修复,需放在public文件夹下

merge-requests/1/head
张鑫 5 years ago
parent e7a985071a
commit 0c356c5fb5

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

@ -8,8 +8,8 @@ import './layouts/index'
import utils from './utils/index'
import api from './plugins/axios/index'
import JSMpeg from './utils/jsmpeg.min'
import vxgplayer from './utils/video_play_plugins/vxgplayer-1.8.54.min'
import './utils/video_play_plugins/vxgplayer-1.8.54.min.css'
import vxgplayer from '../public/video_play_plugins/vxgplayer-1.8.54.min'
import '../public/video_play_plugins/vxgplayer-1.8.54.min.css'
Vue.config.productionTip = false
Vue.prototype.$utils = utils
Vue.prototype.$api = api

@ -26,7 +26,7 @@
:url="i.rtsp"
autostart
avsync
nmf-src="video_play_plugins/pnacl/Release/media_player.nmf"
nmf-src="/video_play_plugins/pnacl/Release/media_player.nmf"
nmf-path="media_player.nmf"
width="390" height="219"
latency="0"
@ -69,7 +69,6 @@ export default {
data() {
return {
// true false
videoWarpShow:true,
controlLabel: true,
realTimeListData:[],
url:"722e6f04-bb3c-34b1-bcc7-ae9f6cd72e68",
@ -82,60 +81,18 @@ export default {
},
inject: ['reload'],
mounted() {
this.getRealTimeList()
console.log('index mounted执行了')
this.getRealTimeList()
// this.getSdVideos()
// this.playVideo()
},
destroyed(){
console.log('2222222')
// this.player.destroy()
},
methods: {
//
// handleUpDown() {
// this.controlLabel = !this.controlLabel;
// },
// getSdVideos(channel,id,that){
// console.log('getSdVideos')
// var url = 'ws://192.168.66.56:9007/api/lychee/stream/live/'+channel
// // var url = 'ws://127.0.0.1:9007/api/lychee/stream/live/'+ channel
// var player = new JSMpeg.Player(url, {
// canvas: document.querySelector('.video'+id),
// audio: false,
// pauseWhenHidden: false,
// videoBufferSize: 16 * 1024 * 1024,
// loop:false,
// onPlay: function() {
// //
// console.log('play')
// },
// onEnded: function() {
// //
// console.log('end')
// },
// onPause:function(){
// //
// console.log('pause')
// },
// onVideoDecode:function(){
// //
// }
//
// })
// player.play()
// return that.player=player
// },
playVideo(id,rtsp){
this.videoWarpShow = true;
// url ---tick TypeError: t.module.postMessage is not a function
this.$nextTick(() => {
// window.vxgplayer('vxg_media_player1').stop();
window.vxgplayer(id).src(rtsp);
window.vxgplayer(id).play();
})
},
getRealTimeList(){
var that=this
this.$api.httpApi.getRealTimeList({
@ -153,20 +110,6 @@ export default {
// console.log(item.rtsp)
console.log('进来第二层循环了')
$that.playVideo('video'+item.id,item.rtsp)
// $that.$api.httpApi.getChannel({
// data: {
// "clarity": "SD", //SD
// "sourceUrl": item.rtsp,
// "paramBefore": "-y -i",
// "paramBehind": "-f mpegts -codec:v mpeg1video -an -s 400*225 -b:v 500k -r 20 -bf 0 -codec:a mp2 -ar 44100 -ac 1 -b:a 128k"
// }
// }).then(res => {
// console.log(res.data)
// console.log('pushchannel')
// $that.getSdVideos(res.data.channel, item.id, $that)
// }).catch(err => {
// console.log(err)
// })
})
})
}
@ -174,6 +117,14 @@ export default {
console.log(err)
})
},
playVideo(id,rtsp){
// url ---tick TypeError: t.module.postMessage is not a function
this.$nextTick(() => {
// window.vxgplayer('vxg_media_player1').stop();
window.vxgplayer(id).src(rtsp);
window.vxgplayer(id).play();
})
},
tabsChange(key){
console.log(key)
},

Loading…
Cancel
Save