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