seek生效
This commit is contained in:
@@ -52,21 +52,6 @@
|
||||
@tap="renderScript.changeVideoScreen"></div>
|
||||
</div>
|
||||
</view>
|
||||
<!-- <view style="width: 100%; height: 200px; position: relative" v-else>
|
||||
<video
|
||||
@timeupdate="videoTimeUpdateEvent($event)"
|
||||
ref="videos"
|
||||
style="width: 100%; height: 100%"
|
||||
autoplay
|
||||
id="videoId"
|
||||
object-fit="contain"
|
||||
class="video-box"
|
||||
:src="videoUrl"
|
||||
:poster="`${videoUrl}?x-oss-process=video/snapshot,t_${1},f_jpg`"
|
||||
@play="playVideo"
|
||||
>
|
||||
</video>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@@ -77,7 +62,6 @@
|
||||
mapMutations
|
||||
} from "vuex";
|
||||
|
||||
// importScripts('@/static/aliplayer/aliplayer-min.js')
|
||||
export default {
|
||||
props: ["currentVideo", "currentVideoList","videoTitle"],
|
||||
data() {
|
||||
@@ -124,8 +108,6 @@
|
||||
this.handleEnd();
|
||||
console.log("是否走啦习销毁");
|
||||
clearInterval(this.$store.state.videoTimer);
|
||||
// this.timer = null;
|
||||
// store.commit("setLoadingShow", null);
|
||||
plus.screen.lockOrientation("portrait-primary");
|
||||
|
||||
console.log("是否走啦习销毁定时器", this.timer);
|
||||
@@ -136,42 +118,14 @@
|
||||
});
|
||||
// #ifdef APP-PLUS
|
||||
plus.screen.lockOrientation("portrait-primary"); //锁死屏幕方向为竖屏
|
||||
|
||||
// plus.screen.lockOrientation("portrait-primary");
|
||||
// #endif
|
||||
|
||||
await this.setVideoTime();
|
||||
// this.player.dispose();
|
||||
},
|
||||
|
||||
//第一次加载
|
||||
onLoad(options) {
|
||||
// console.log(options, "这是传参");
|
||||
// // #ifdef APP-PLUS
|
||||
// setTimeout(() => {
|
||||
// plus.screen.unlockOrientation();
|
||||
// plus.screen.lockOrientation("landscape-primary");
|
||||
// }, 10);
|
||||
// // #endif
|
||||
// // #ifdef APP-PLUS
|
||||
// // plus.screen.lockOrientation("portrait-primary");
|
||||
// // #endif
|
||||
// if (uni.getStorageSync("videoOssList")) {
|
||||
// this.videoList = JSON.parse(uni.getStorageSync("videoOssList"));
|
||||
// }
|
||||
// console.log("this.videoList at line 53:", this.videoList);
|
||||
// this.options = JSON.parse(options.data);
|
||||
// this.videoId = this.options.video;
|
||||
// this.timer = setInterval(() => {
|
||||
// var that = this;
|
||||
// if (this.currentTime) {
|
||||
// that.setVideoTime();
|
||||
// }
|
||||
// }, 2000);
|
||||
// this.$emit("child-event", this.timer);
|
||||
// // this.$once("hook:beforeDestroy", () => {
|
||||
// // clearInterval(this.timer);
|
||||
// // });
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -179,7 +133,6 @@
|
||||
this.show = true;
|
||||
},
|
||||
start() {
|
||||
// var playerView = this.$refs.playerView;
|
||||
this.$refs.playerView.start();
|
||||
},
|
||||
pause() {
|
||||
@@ -205,13 +158,6 @@
|
||||
);
|
||||
this.isFullScreen = !data.status;
|
||||
this.$emit("changeScreen", this.isFullScreen);
|
||||
// let fullScreen = e.detail.fullScreen; // 值true为进入全屏,false为退出全屏
|
||||
// if (!fullScreen) {
|
||||
// //退出全屏
|
||||
// this.isFullScreen = false;
|
||||
// } else {
|
||||
// this.isFullScreen = true;
|
||||
// }
|
||||
},
|
||||
// 控制器的显示隐藏
|
||||
controlChange(e) {
|
||||
@@ -223,16 +169,16 @@
|
||||
ctx.exitFullScreen();
|
||||
},
|
||||
// 播放进度改变
|
||||
videoTimeUpdateEvent(e) {
|
||||
this.playTime = parseInt(e.detail.currentTime);
|
||||
this.currentTime = parseInt(e.detail.currentTime);
|
||||
// videoTimeUpdateEvent(e) {
|
||||
// this.playTime = parseInt(e.detail.currentTime);
|
||||
// this.currentTime = parseInt(e.detail.currentTime);
|
||||
|
||||
this.allTime = parseInt(e.detail.duration);
|
||||
// this.allTime = parseInt(e.detail.duration);
|
||||
|
||||
this.recordTime({
|
||||
time: this.playTime,
|
||||
});
|
||||
},
|
||||
// this.recordTime({
|
||||
// time: this.playTime,
|
||||
// });
|
||||
// },
|
||||
async init(data, isChange) {
|
||||
this.show = false;
|
||||
this.platform = this.$platform;
|
||||
@@ -246,8 +192,6 @@
|
||||
this.videoId = this.options.video;
|
||||
console.log("这是苹果视屏id", this.videoId);
|
||||
await this.getLive(isChange);
|
||||
// await this.getVideo(isChange);
|
||||
// this.$emit("child-event", this.timer);
|
||||
},
|
||||
async getVideo() {
|
||||
var data = {};
|
||||
@@ -266,12 +210,6 @@
|
||||
console.log(" 视频播放11111111111:", res);
|
||||
|
||||
var credentials = res.result.credentials;
|
||||
// var playerView = this.$refs.playerView;
|
||||
// console.log('playerView at line 273:', playerView)
|
||||
/*
|
||||
STS加密播放
|
||||
|
||||
*/
|
||||
that.$refs.playerView.setVidSts({
|
||||
vid: this.videoData.video,
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
@@ -280,10 +218,6 @@
|
||||
expireTime: credentials.expireTime,
|
||||
Region: "cn-shanghai",
|
||||
});
|
||||
// playerView.setLocalSource({
|
||||
// uri: "http://duoduovideo.oss-cn-beijing.aliyuncs.com/5f093c6fb6e90.mp4",
|
||||
// });
|
||||
|
||||
let isFullScreen = true;
|
||||
// fixed fullscreen play on android
|
||||
if (plus.os.name.toLowerCase() === "android") {
|
||||
@@ -323,8 +257,9 @@
|
||||
var list = [];
|
||||
if (uni.getStorageSync("videoOssList")) {
|
||||
list = JSON.parse(uni.getStorageSync("videoOssList"));
|
||||
var index = list.findIndex((e) => e.id == data.id);
|
||||
|
||||
var index = list.findIndex((e) => e.id == data.id);
|
||||
console.log('data.id',data.id);
|
||||
if (netWork) {
|
||||
if (index >= 0) {
|
||||
this.firstTime =
|
||||
@@ -345,28 +280,21 @@
|
||||
|
||||
this.videoData = {
|
||||
...data,
|
||||
firstTime : this.firstTime
|
||||
};
|
||||
this.isChange = isChange ? isChange : false;
|
||||
// this.currentTime = this.firstTime;
|
||||
console.log(this.firstTime, "这是第一次播放时长222");
|
||||
// await this.setVideoTime();
|
||||
uni.setStorageSync("videoOssList", JSON.stringify(list));
|
||||
|
||||
// if (this.currentVideo.type == 0 || this.currentVideo.type == 2) {
|
||||
// await this.playVideo();
|
||||
// }
|
||||
console.log(this.firstTime, "这是第一次播放时长");
|
||||
// await that.getVideo();
|
||||
}
|
||||
this.isSetFirstTime = true;
|
||||
},
|
||||
async playVideo(e) {
|
||||
this.videoContext = uni.createVideoContext("videoId", this);
|
||||
this.videoContext.seek(this.firstTime);
|
||||
|
||||
// this.videoContext.requestFullScreen();
|
||||
},
|
||||
recordTime(data) {
|
||||
// console.log('recordTime',data.time);
|
||||
this.currentTime = data.time;
|
||||
|
||||
var list = [];
|
||||
@@ -375,10 +303,11 @@
|
||||
}
|
||||
|
||||
var index = list.findIndex((e) => e.id == this.videoData.id);
|
||||
// console.log('recordTime------',index,list );
|
||||
|
||||
if (list.length > 0 && index >= 0) {
|
||||
list[index] = {
|
||||
...this.videoData,
|
||||
|
||||
time: data.time,
|
||||
};
|
||||
} else {
|
||||
@@ -430,11 +359,11 @@
|
||||
var data = {
|
||||
...res.video,
|
||||
};
|
||||
console.log("/checkjieguo", data);
|
||||
// console.log("/checkjieguo", data);
|
||||
// return
|
||||
if (this.currentVideo.type == 1) {
|
||||
var playAuth = res.video.playAuth.replace(/=/g, "");
|
||||
console.log("这是接口获取的视屏凭证111", playAuth);
|
||||
// console.log("这是接口获取的视屏凭证111", playAuth);
|
||||
data = {
|
||||
...data,
|
||||
videoId: res.video.video,
|
||||
@@ -457,14 +386,13 @@
|
||||
});
|
||||
},
|
||||
async handleEnd() {
|
||||
console.log('进来了吗,handleEnd')
|
||||
console.log("找到了吗????",this.videoData.id);
|
||||
// console.log('uni.getStorageSync("videoOssList")',uni.getStorageSync("videoOssList"));
|
||||
var list = JSON.parse(JSON.stringify(uni.getStorageSync("videoOssList")));
|
||||
|
||||
// console.log('进来了吗,handleEnd')
|
||||
console.log("找到了吗????",this.videoData.id);
|
||||
var list = JSON.parse(uni.getStorageSync("videoOssList"));
|
||||
var data = list.find((e) => e.id == this.videoData.id);
|
||||
console.log("找到了吗????");
|
||||
this.currentTime = data.time;
|
||||
// data.time ? this.currentTime = data.time : this.currentTime = 0;
|
||||
this.currentTime = data.time;
|
||||
console.log(
|
||||
"this.currentTime at line 这是结束的时候掉的存储视频:",
|
||||
this.currentTime
|
||||
@@ -472,15 +400,9 @@
|
||||
await this.setVideoTime();
|
||||
clearInterval(this.$store.state.videoTimer);
|
||||
this.timer = null;
|
||||
|
||||
|
||||
},
|
||||
setVideoTime(time) {
|
||||
var data = {};
|
||||
// var list = uni.getStorageSync("videoOssList");
|
||||
|
||||
// data = list.find((e) => e.id == this.videoData.id);
|
||||
// console.log("这是再走生命周期哦", this.currentTime);
|
||||
console.log("是否走了存储视屏," + this.videoData.id, this.currentTime);
|
||||
var data = {
|
||||
videoId: this.videoData.id,
|
||||
@@ -502,10 +424,10 @@
|
||||
this.$forceUpdate();
|
||||
});
|
||||
},
|
||||
changePlayerTime(player) {
|
||||
console.log("this.firstTime at line 106:", this.firstTime);
|
||||
player.seek(this.firstTime);
|
||||
},
|
||||
// changePlayerTime(player) {
|
||||
// console.log("this.firstTime at line 106:", this.firstTime);
|
||||
// player.seek(this.firstTime);
|
||||
// },
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
@@ -515,10 +437,6 @@
|
||||
async setVideoFirtsetTime(time) {
|
||||
this.currentTime = this.firstTime;
|
||||
console.log("这里准备开始设置播放时间:", this.currentTime);
|
||||
// await this.setVideoTime();
|
||||
// setTimeout(() => {
|
||||
// clearInterval(this.$store.state.videoTimer);
|
||||
|
||||
store.commit(
|
||||
"setVideoTimer",
|
||||
setInterval(async () => {
|
||||
@@ -536,18 +454,9 @@
|
||||
</script>
|
||||
|
||||
<script module="renderScript" lang="renderjs">
|
||||
var videoData = null
|
||||
import $ from 'jquery'
|
||||
// import StaticADComponent from './staticadcomponent/index.js';
|
||||
/**
|
||||
* 静态广告组件
|
||||
*/
|
||||
|
||||
|
||||
export default {
|
||||
/**
|
||||
* 静态广告组件
|
||||
*/
|
||||
|
||||
components: {
|
||||
// MyComponent
|
||||
},
|
||||
@@ -555,7 +464,6 @@
|
||||
// 在适合的生命周期,通过script和link标签引入播放器sdk、css
|
||||
console.log(this.options, '这是monted')
|
||||
this.loadWebPlayerSDK()
|
||||
// this.loadComponent()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -567,11 +475,7 @@
|
||||
// currentTime:null,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
watch: {
|
||||
|
||||
|
||||
curTime(val) {
|
||||
|
||||
if (this.curTime !== null && this.curStatus !== null) {
|
||||
@@ -579,19 +483,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
handleClick(event, ownerInstance) {
|
||||
console.log('是否了走了点击video事件', event)
|
||||
// this.player.on('ready',function(){
|
||||
// var status= this.player.fullscreenService.getIsFullScreen()
|
||||
// console.log('status at line 403:', status)
|
||||
// console.log('触发点击事件',status))
|
||||
// })
|
||||
|
||||
// ownerInstance.callMethod('getData')
|
||||
|
||||
},
|
||||
emitData(event, ownerInstance) {
|
||||
var that = this;
|
||||
@@ -602,42 +496,15 @@
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
|
||||
async receiveFirstTime(newValue, oldValue, ownerVm, vm) {
|
||||
|
||||
// if (this.player) {
|
||||
// // this.firstTime=newValue;
|
||||
// // console.log('这是初始播放时间111', this.firstTime,this.player)
|
||||
// // await this.player.seek(newValue);
|
||||
// await this.$refs.videoContent4.click()
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
|
||||
},
|
||||
async receiveisSetFirstTime(newValue, oldValue, ownerVm, vm) {
|
||||
console.log('是否刚开始设置播放时间', newValue, this.firstTime, this.player);
|
||||
// if (this.player) {
|
||||
// // this.firstTime=newValue;
|
||||
// // await this.player.seek(this.firstTime);
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
|
||||
},
|
||||
|
||||
emitSetData(event, ownerInstance) {
|
||||
var that = this;
|
||||
// this.player.seek(this.firstTime)
|
||||
console.log('是否设置的第一次初始播放', this.firstTime, this.videoData.id);
|
||||
|
||||
|
||||
ownerInstance.callMethod('setVideoFirtsetTime')
|
||||
|
||||
},
|
||||
@@ -648,77 +515,38 @@
|
||||
var that = this;
|
||||
// this.$emit('changeScreenLoading',true)
|
||||
var status = this.player.fullscreenService.getIsFullScreen();
|
||||
|
||||
|
||||
|
||||
ownerInstance.callMethod('screenChange', {
|
||||
status: status,
|
||||
primary: status ? 'portrait' : 'landscape'
|
||||
})
|
||||
|
||||
|
||||
if (status) {
|
||||
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
plus.screen.lockOrientation("portrait-primary"); //锁死屏幕方向为竖屏
|
||||
this.player.fullscreenService.cancelFullScreen();
|
||||
// this.$emit('changeScreenLoading',false);
|
||||
|
||||
|
||||
}, 100);
|
||||
|
||||
|
||||
// this.player.setPlayerSize('100%','200px');
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
// this.player.setPlayerSize({
|
||||
// w:"400px",
|
||||
// height:'60%'
|
||||
// });
|
||||
// plus.screen.unlockOrientation();
|
||||
this.player.fullscreenService.requestFullScreen();
|
||||
setTimeout(() => {
|
||||
// this.$emit('changeScreenLoading',false);
|
||||
plus.screen.lockOrientation("landscape-primary");
|
||||
|
||||
}, 100);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
changeVideoData(event, ownerInstance) {
|
||||
var that = this;
|
||||
|
||||
ownerInstance.callMethod('changeVideoData', )
|
||||
},
|
||||
endEmitData(event, ownerInstance) {
|
||||
var that = this;
|
||||
|
||||
ownerInstance.callMethod('handleEnd', )
|
||||
},
|
||||
getLive() {
|
||||
console.log('这是这只只是666666:', this.firstTime, this.videoData)
|
||||
|
||||
if (this.player) {
|
||||
|
||||
this.player.dispose();
|
||||
$('#url-player-test').empty();
|
||||
this.player = null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
var fullScreenButtonComponent = Aliplayer.Component({
|
||||
/**
|
||||
* 初始函数,在new对象时调用
|
||||
@@ -729,9 +557,6 @@
|
||||
init: function(status, toAddress) {
|
||||
|
||||
this.fullScreenStatus = status
|
||||
// this.adAddress = adAddress;
|
||||
// this.toAddress = toAddress;
|
||||
|
||||
this.$html = $('.fullScreenButton-container');
|
||||
// this.$html.hide();
|
||||
},
|
||||
@@ -740,18 +565,12 @@
|
||||
* 创建广告Dom元素
|
||||
*/
|
||||
createEl: function(el) {
|
||||
|
||||
|
||||
this.$html.find('.ad').attr('src', this.adAddress);
|
||||
var $adWrapper = this.$html.find('.ad-wrapper');
|
||||
$adWrapper.attr('href', this.toAddress);
|
||||
$adWrapper.click(function() {
|
||||
// Aliplayer.util.stopPropagation();
|
||||
|
||||
});
|
||||
// this.$html.find('.close').click(function () {
|
||||
// this.$html.hide();
|
||||
// });
|
||||
// $(el).find('.prism-controlbar').append(this.$html);
|
||||
$(el).find('.prism-time-display').after(this.$html);
|
||||
},
|
||||
ready: function(player, e) {
|
||||
@@ -777,6 +596,7 @@
|
||||
// this.$html.hide();
|
||||
},
|
||||
waiting: function(player, e) {
|
||||
|
||||
// this.$html.hide()
|
||||
},
|
||||
timeupdate: function(player, e) {},
|
||||
@@ -785,20 +605,14 @@
|
||||
* 显示广告
|
||||
*/
|
||||
ended: function(player, e) {
|
||||
// this.$html.show();
|
||||
}
|
||||
});
|
||||
|
||||
console.log('这是查看是否获取到hlstoken', this.videoData.mtsHlsUriToken, this.videoData)
|
||||
|
||||
|
||||
console.log('这是查看是否获取到hlstoken', this.videoData)
|
||||
var playerOptions = {
|
||||
id: "url-player-test",
|
||||
width: '100%', //容器的大小
|
||||
height: '100%', //容器的大小
|
||||
"qualitySort": "asc",
|
||||
// "format": "m3u8",
|
||||
// "mediaType": "video",
|
||||
"cover": "",
|
||||
"autoplay": true,
|
||||
"isLive": false,
|
||||
@@ -806,18 +620,7 @@
|
||||
"playsinline": true,
|
||||
"controlBarVisibility": "hover",
|
||||
"useH5Prism": true,
|
||||
// cover: "",
|
||||
components: [
|
||||
// {
|
||||
// name: 'BulletScreenComponent',
|
||||
// type: AliPlayerComponent.BulletScreenComponent,
|
||||
// /** Descriptions of the scrolling text component parameters: text, style, bulletPosition
|
||||
// * text: The scrolling text
|
||||
// * style: The style of the scrolling text
|
||||
// * bulletPosition: The position of the scrolling text. Valid values: 'top', 'bottom', and 'random'. The default is 'random'.
|
||||
// */
|
||||
// args: ['http://101.201.146.165:8088/Pf-EH/statics/uploadFile/2024-05-10/b0f420c7-9178-41ad-9dd6-f59a64a6e190.png']
|
||||
// },
|
||||
{
|
||||
name: 'adComponent',
|
||||
type: fullScreenButtonComponent,
|
||||
@@ -830,13 +633,6 @@
|
||||
type: AliPlayerComponent.RateComponent
|
||||
},
|
||||
|
||||
|
||||
// {
|
||||
// name: 'RotateMirrorComponent',
|
||||
// type: AliPlayerComponent.RotateMirrorComponent
|
||||
// },
|
||||
|
||||
|
||||
],
|
||||
|
||||
skinLayout: [{
|
||||
@@ -890,14 +686,6 @@
|
||||
x: 10,
|
||||
y: 7
|
||||
},
|
||||
// {name: "fullScreenButton", align: "tr", x: 10, y: 12},
|
||||
// {name:"subtitle", align:"tr",x:15, y:12},
|
||||
// {
|
||||
// name: "setting",
|
||||
// align: "tr",
|
||||
// x: 15,
|
||||
// y: 12
|
||||
// },
|
||||
{
|
||||
name: "prism-speed-selector",
|
||||
align: "tr",
|
||||
@@ -955,53 +743,18 @@
|
||||
var player = new Aliplayer(playerOptions, function(player) {});
|
||||
this.player = player;
|
||||
console.log('是否拿到第一次初始值呢', this.platform, typeof this.firstTime, this.firstTime)
|
||||
if (this.platform == 'ios') {
|
||||
|
||||
this.player.one('timeupdate', () => {
|
||||
this.player.seek(this.firstTime);
|
||||
})
|
||||
|
||||
player.on('canplay', function() {
|
||||
console.log('这是ios数据缓冲初次设置播放位置判断!!!!')
|
||||
this.player.seek(this.firstTime);
|
||||
})
|
||||
// var seeked = false;
|
||||
// player.on('loadedmetadata',function (e) {
|
||||
// if(!seeked)
|
||||
// {
|
||||
// seeked = true;
|
||||
// this.player.seek(20);
|
||||
// }
|
||||
// });
|
||||
// player.on('waiting',function(){
|
||||
// console.log('这是ios数据缓冲初次设置播放位置判断!!!!')
|
||||
// setTimeout(()=>{
|
||||
// player.seek(this.firstTime)
|
||||
// },500)
|
||||
|
||||
// })
|
||||
} else {
|
||||
// if(player){
|
||||
this.player.seek(this.firstTime)
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// var seeked = false;
|
||||
// this.player.on('loadedmetadata',function (e) {
|
||||
// if(!seeked)
|
||||
// {
|
||||
// seeked = true;
|
||||
// player.seek(this.firstTime);
|
||||
// }
|
||||
// });
|
||||
// if (this.platform == 'ios') {
|
||||
|
||||
// this.player.one('timeupdate', () => {
|
||||
// this.player.seek(this.firstTime);
|
||||
// })
|
||||
|
||||
// } else {
|
||||
// // if(player){
|
||||
// this.player.seek(this.firstTime)
|
||||
// // }
|
||||
|
||||
// }
|
||||
|
||||
clearInterval(this.videoTimer);
|
||||
|
||||
@@ -1015,39 +768,20 @@
|
||||
}, 1000);
|
||||
this.$refs.videoContent4.click()
|
||||
player.on('ready', function() {
|
||||
|
||||
// player.fullscreenService.requestFullScreen()
|
||||
|
||||
})
|
||||
|
||||
// this.
|
||||
|
||||
|
||||
// this.$refs.videoContent.click()
|
||||
player.one('canplay', function() {
|
||||
console.log('这是ios数据缓冲初次设置播放位置判断!!!!',videoData)
|
||||
// player.seek(20);
|
||||
player.seek(videoData.firstTime);
|
||||
})
|
||||
this.player.on('playing', function() {
|
||||
console.log('正在播放')
|
||||
})
|
||||
this.player.on('ended', function() {
|
||||
// console.log('that.curTime at line 242:', this.curTime)
|
||||
// console.log('that.curStatus at line 210:', this.curStatus)
|
||||
this.$refs.videoContent2.click()
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// player.setRotate(90)
|
||||
|
||||
//全屏播放
|
||||
|
||||
// player.one('canplay', function() {
|
||||
// // console.log('canplay', this.player.tag);
|
||||
// player.tag.play();
|
||||
|
||||
// });
|
||||
|
||||
|
||||
|
||||
},
|
||||
showPreview(e) {
|
||||
// console.log('e at line 56:', e)
|
||||
@@ -1064,12 +798,6 @@
|
||||
}
|
||||
console.log('imgList.push at line 64:', imgList)
|
||||
|
||||
|
||||
//最后一步就是所有图片放在预览的方法previewImage中就可以了
|
||||
// uni.previewImage({
|
||||
// current: imgList,
|
||||
// urls: imgList,
|
||||
// })
|
||||
uni.previewImage({
|
||||
urls: imgList,
|
||||
longPressActions: {
|
||||
@@ -1081,10 +809,7 @@
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
receiveScreenType(newValue) {
|
||||
// console.log('newValue at line 427屏幕方向111111111111:', newValue)
|
||||
|
||||
},
|
||||
async receiveIsfresh(newValue) {
|
||||
|
||||
@@ -1093,77 +818,31 @@
|
||||
clearInterval(this.$store.state.videoTimer)
|
||||
// await this.setVideoTime();
|
||||
this.player.dispose();
|
||||
// $('#url-player-test').empty()
|
||||
|
||||
// this.player.seek(newValue);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
async receiveplatform(newValue) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
async receiveIsChange(newValue) {
|
||||
|
||||
|
||||
// this.timer=null
|
||||
|
||||
if (this.isChange) {
|
||||
|
||||
this.checkValue()
|
||||
|
||||
// if (this.videoData.type == 1) {
|
||||
// console.log('是否走了切换加密视频方法:', this.isChange, this.videoData)
|
||||
// await this.player.replayByVidAndPlayAuth(this.videoData.video, this.videoData.playAuth)
|
||||
// this.$refs.videoContent.click()
|
||||
// } else {
|
||||
// console.log('是否走了切换老视频/音频方法:', this.isChange, this.videoData)
|
||||
// await this.player.loadByUrl(this.videoData.videoUrl)
|
||||
// this.$refs.videoContent.click()
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
// this.$refs.videoContent3.click()
|
||||
|
||||
},
|
||||
|
||||
receiveVideoList(newValue, oldValue, ownerVm, vm) {
|
||||
// //数据变化
|
||||
|
||||
console.log('currentVideoListcurrentVideoListcurrentVideoList', newValue)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
receiveMsg(newValue, oldValue, ownerVm, vm) {
|
||||
//数据变化
|
||||
// console.log('newValue', newValue)
|
||||
// console.log('oldValue', oldValue)
|
||||
// console.log('ownerVm', ownerVm)
|
||||
// console.log('vm', vm)
|
||||
videoData = newValue
|
||||
},
|
||||
receiveWinWidth(newValue, oldValue, ownerVm, vm) {
|
||||
//数据变化
|
||||
console.log('newValue', newValue)
|
||||
// console.log('oldValue', oldValue)
|
||||
// console.log('ownerVm', ownerVm)
|
||||
// console.log('vm', vm)
|
||||
},
|
||||
receiveWinHeight(newValue, oldValue, ownerVm, vm) {
|
||||
//数据变化
|
||||
console.log('newValue', newValue)
|
||||
// console.log('oldValue', oldValue)
|
||||
// console.log('ownerVm', ownerVm)
|
||||
// console.log('vm', vm)
|
||||
},
|
||||
checkValue() {
|
||||
console.log(this.videoId, this.authId, this.videoData, "1111888888")
|
||||
@@ -1179,9 +858,6 @@
|
||||
},
|
||||
loadWebPlayerSDK() {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
|
||||
|
||||
const s_tag = document.createElement('script'); // 引入播放器js
|
||||
s_tag.type = 'text/javascript';
|
||||
s_tag.src = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.20.3/aliplayer-min.js';
|
||||
@@ -1195,38 +871,18 @@
|
||||
s_tag1.onload = () => {
|
||||
this.checkValue();
|
||||
resolve();
|
||||
|
||||
}
|
||||
document.body.appendChild(s_tag1);
|
||||
|
||||
}
|
||||
document.body.appendChild(s_tag);
|
||||
|
||||
|
||||
|
||||
const l_tag = document.createElement('link'); // 引入播放器css
|
||||
l_tag.rel = 'stylesheet';
|
||||
l_tag.href =
|
||||
'https://g.alicdn.com/apsara-media-box/imp-web-player/2.20.3/skins/default/aliplayer-min.css';
|
||||
|
||||
|
||||
|
||||
document.body.appendChild(l_tag);
|
||||
});
|
||||
},
|
||||
loadComponent() {
|
||||
// return new Promise((resolve, reject) => {
|
||||
// const s_tag = document.createElement('script');
|
||||
// s_tag.type = 'text/javascript';
|
||||
// // 需要先下载组件 js 文件,放到项目 /static/ 目录下
|
||||
// // 下载地址:https://github.com/aliyunvideo/AliyunPlayer_Web/blob/master/customComponents/dist/aliplayer-components/aliplayercomponents-1.0.9.min.js
|
||||
// s_tag.src = '@/static/aliplayercomponents.js';
|
||||
// s_tag.charset = 'utf-8';
|
||||
// s_tag.onload = () => {
|
||||
// resolve();
|
||||
// }
|
||||
// document.body.appendChild(s_tag);
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user