2023年10月24日 删除超时退出的逻辑,修改主播放界面和子播放界面播放不了的问题
This commit is contained in:
parent
f15a09b94f
commit
c08f36d16d
|
@ -73,9 +73,10 @@ export const transform: AxiosTransform = {
|
|||
switch (code) {
|
||||
case ResultEnum.TIMEOUT:
|
||||
timeoutMsg = t('sys.api.timeoutMessage');
|
||||
const userStore = useUserStoreWithOut();
|
||||
userStore.setToken(undefined);
|
||||
userStore.logout(true);
|
||||
//请求超时,不再退出登录。
|
||||
// const userStore = useUserStoreWithOut();
|
||||
// userStore.setToken(undefined);
|
||||
// userStore.logout(true);
|
||||
break;
|
||||
default:
|
||||
if (message) {
|
||||
|
|
|
@ -68,69 +68,69 @@ function init(){
|
|||
player.value = playerMain;
|
||||
|
||||
|
||||
playerMain.ready(function() {
|
||||
// playerMain.controlBar.addChild('TitleBar', {
|
||||
// // text: '快退',
|
||||
// el: videojs.createEl('button', {
|
||||
// title: '快退十秒',
|
||||
// className: 'vjs-icon-previous-item vjs-fast-replay-button vjs-control vjs-button',
|
||||
// innerHTML: '<span aria-hidden="true" class="vjs-icon-placeholder"></span><span class="vjs-control-text" aria-live="polite">快退</span>'
|
||||
// playerMain.ready(function() {
|
||||
// // playerMain.controlBar.addChild('TitleBar', {
|
||||
// // // text: '快退',
|
||||
// // el: videojs.createEl('button', {
|
||||
// // title: '快退十秒',
|
||||
// // className: 'vjs-icon-previous-item vjs-fast-replay-button vjs-control vjs-button',
|
||||
// // innerHTML: '<span aria-hidden="true" class="vjs-icon-placeholder"></span><span class="vjs-control-text" aria-live="polite">快退</span>'
|
||||
// // }),
|
||||
// // clickHandler: function() {
|
||||
// // playerMain.currentTime(playerMain.currentTime() - 10);
|
||||
// // }
|
||||
// // });
|
||||
|
||||
// // console.log('videojs ->',videojs);
|
||||
|
||||
|
||||
// // let buttonList:Array<String> = [];
|
||||
// let currentSources:any = playerMain.currentSources();
|
||||
// // currentSources?.forEach(x => {
|
||||
// // buttonList.push(`<option value ="" style="color: black;">高清</option>`);
|
||||
// // })
|
||||
// let currentSource = currentSources[0];
|
||||
|
||||
// let _playerMain: any = playerMain;
|
||||
// let _videojs: any = videojs;
|
||||
|
||||
|
||||
// return;
|
||||
// _playerMain.controlBar.addChild('Button', {
|
||||
// text: '选择清晰度',
|
||||
// el: _videojs.createEl('button', {
|
||||
// title: '选择清晰度',
|
||||
// className: 'vjs-control',
|
||||
// innerHTML: `
|
||||
// <select class="changeDefinitionBtn" style="-webkit-appearance: none;background-color: rgba(0,0,0,0);border-radius: 0px" data-url="${currentSource || ''}">
|
||||
// <option value ="" style="color: black;">原画</option>
|
||||
// <option value ="_hi" style="color: black;">高清</option>
|
||||
// <option value ="_mid" style="color: black;">流畅</option>
|
||||
// <option value="_low" style="color: black;">标清</option>
|
||||
// </select>
|
||||
// `
|
||||
// }),
|
||||
// clickHandler: function() {
|
||||
// playerMain.currentTime(playerMain.currentTime() - 10);
|
||||
// let el:any = playerMain.el().querySelector('.changeDefinitionBtn');
|
||||
// let currentSources:any = playerMain.currentSources();
|
||||
// let oldUrl = currentSources[0]?.src;
|
||||
// if(el){
|
||||
// let suffix = el.options[el.options.selectedIndex].value;
|
||||
// let url = el.dataset.url;
|
||||
// if(url){
|
||||
// if(suffix){//空的情况下是原画
|
||||
// url = url.replaceAll('.m3u8','');
|
||||
// url += suffix + '.m3u8';
|
||||
// }
|
||||
// if(oldUrl != url){//地址完全一样,别切了,,
|
||||
// playerMain.src([{ type: 'application/x-mpegURL', src: url}]);
|
||||
// playerMain.play();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// console.log('videojs ->',videojs);
|
||||
|
||||
|
||||
// let buttonList:Array<String> = [];
|
||||
let currentSources:any = playerMain.currentSources();
|
||||
// currentSources?.forEach(x => {
|
||||
// buttonList.push(`<option value ="" style="color: black;">高清</option>`);
|
||||
// })
|
||||
let currentSource = currentSources[0];
|
||||
|
||||
let _playerMain: any = playerMain;
|
||||
let _videojs: any = videojs;
|
||||
|
||||
|
||||
return;
|
||||
_playerMain.controlBar.addChild('Button', {
|
||||
text: '选择清晰度',
|
||||
el: _videojs.createEl('button', {
|
||||
title: '选择清晰度',
|
||||
className: 'vjs-control',
|
||||
innerHTML: `
|
||||
<select class="changeDefinitionBtn" style="-webkit-appearance: none;background-color: rgba(0,0,0,0);border-radius: 0px" data-url="${currentSource || ''}">
|
||||
<option value ="" style="color: black;">原画</option>
|
||||
<option value ="_hi" style="color: black;">高清</option>
|
||||
<option value ="_mid" style="color: black;">流畅</option>
|
||||
<option value="_low" style="color: black;">标清</option>
|
||||
</select>
|
||||
`
|
||||
}),
|
||||
clickHandler: function() {
|
||||
let el:any = playerMain.el().querySelector('.changeDefinitionBtn');
|
||||
let currentSources:any = playerMain.currentSources();
|
||||
let oldUrl = currentSources[0]?.src;
|
||||
if(el){
|
||||
let suffix = el.options[el.options.selectedIndex].value;
|
||||
let url = el.dataset.url;
|
||||
if(url){
|
||||
if(suffix){//空的情况下是原画
|
||||
url = url.replaceAll('.m3u8','');
|
||||
url += suffix + '.m3u8';
|
||||
}
|
||||
if(oldUrl != url){//地址完全一样,别切了,,
|
||||
playerMain.src([{ type: 'application/x-mpegURL', src: url}]);
|
||||
playerMain.play();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<headerPage/>
|
||||
<!-- 主体部分 -->
|
||||
<a-layout-content>
|
||||
<div style="width:100%;height: 100%;margin-top: 1rem;" v-if="isError">
|
||||
<div style="width:100%;height: 100%;margin-top: 1rem;" v-if="!isError">
|
||||
<a-row :gutter="[16,16]">
|
||||
<a-col :xs="{ span: 24 }" :sm="{ span: 19 }" :lg="{ span: 19 }">
|
||||
<div>
|
||||
|
@ -161,10 +161,9 @@ onMounted(() => {
|
|||
getSuibi();
|
||||
getKcxx();
|
||||
//记录播放日志
|
||||
|
||||
isError.value = true;
|
||||
}else{
|
||||
isError.value = false;
|
||||
}else{
|
||||
isError.value = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -203,13 +202,17 @@ function changeLive(item:any){
|
|||
console.log(`🚀 --------------------------------------------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: viewPage.vue:164 ~ changeLive ~ mainVideo?.player:`, mainVideo?.player);
|
||||
console.log(`🚀 --------------------------------------------------------------------------------🚀`);
|
||||
let buttonEl = mainVideo?.player.el().querySelector('.changeDefinitionBtn');
|
||||
// let buttonEl = mainVideo?.player.el().querySelector('.changeDefinitionBtn');
|
||||
//赋值原URL
|
||||
if(buttonEl){
|
||||
buttonEl.dataset.url = url;
|
||||
}
|
||||
// if(buttonEl){
|
||||
// buttonEl.dataset.url = url;
|
||||
// }
|
||||
|
||||
curentPlayerVideo.value = item;
|
||||
// nextTick(() => {
|
||||
//增加自动播放功能
|
||||
//mainVideo?.player?.play();
|
||||
// })
|
||||
}
|
||||
|
||||
function mainVideoLoadEnd(player){
|
||||
|
|
|
@ -194,11 +194,11 @@ function changeLive(item:any){
|
|||
console.log(`🚀 --------------------------------------------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: viewPage.vue:164 ~ changeLive ~ mainVideo?.player:`, mainVideo?.player);
|
||||
console.log(`🚀 --------------------------------------------------------------------------------🚀`);
|
||||
let buttonEl = mainVideo?.player.el().querySelector('.changeDefinitionBtn');
|
||||
// let buttonEl = mainVideo?.player.el().querySelector('.changeDefinitionBtn');
|
||||
//赋值原URL
|
||||
if(buttonEl){
|
||||
buttonEl.dataset.url = url;
|
||||
}
|
||||
// if(buttonEl){
|
||||
// buttonEl.dataset.url = url;
|
||||
// }
|
||||
|
||||
curentPlayerVideo.value = item;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue