|
@@ -2,7 +2,6 @@
|
|
|
<div class="H5PlayerVideo">
|
|
|
<div :id="videoData.id" :ref="videoData.id"></div>
|
|
|
<p class="full-screen-button" @click="fullScreen"></p>
|
|
|
- <!--<p class="full-failed-button" v-if="fullScreenType" @click="outFullScreen"></p>-->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -14,7 +13,6 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- fullScreenType:false,
|
|
|
videoCover: localStorage.getItem('fileBrowseEnvironment') + localStorage.getItem('videoCover'),
|
|
|
videoData: {},
|
|
|
}
|
|
@@ -24,7 +22,7 @@
|
|
|
id: 'video_' + this.generateRandomString(),
|
|
|
width: this.videoProps.width ? this.videoProps.width : 600,
|
|
|
height: this.videoProps.height ? this.videoProps.height : 338,
|
|
|
- url: this.videoProps.url
|
|
|
+ url: this.videoProps.url,
|
|
|
})
|
|
|
},
|
|
|
mounted() {
|
|
@@ -33,39 +31,12 @@
|
|
|
let type = this.videoData.url.indexOf('wss') !== -1?1:0;
|
|
|
this.initPlayer(this.videoData.url, 0,type)
|
|
|
})
|
|
|
- if(this.$parent.stopTime){
|
|
|
- document.addEventListener('fullscreenchange', this.fullFunction);
|
|
|
- }
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
- fullFunction(){
|
|
|
- if (!document.fullscreenElement) {
|
|
|
- // 执行退出全屏后的操作
|
|
|
- if (this.fullScreenType){
|
|
|
- this.$set(this,'fullScreenType',false);
|
|
|
- if(this.$parent.outFullScreen){
|
|
|
- this.$parent.outFullScreen();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
//全屏
|
|
|
fullScreen() {
|
|
|
- let self = this;
|
|
|
if(this.$parent.stopTime){
|
|
|
- this.$parent.stopTime();
|
|
|
- this.myPlugin.JS_FullScreenDisplay(true).then(
|
|
|
- (res) => {
|
|
|
- // console.info('JS_FullScreenDisplay success');
|
|
|
- // do you want...
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- // console.info('JS_FullScreenDisplay failed');
|
|
|
- // do you want...
|
|
|
- }
|
|
|
- );
|
|
|
- self.$set(self,'fullScreenType',true);
|
|
|
+ this.$parent.stopTime(this.videoProps.cameraIndexCode);
|
|
|
}else{
|
|
|
this.myPlugin.JS_FullScreenDisplay(true).then(
|
|
|
(res) => {
|
|
@@ -77,24 +48,8 @@
|
|
|
// do you want...
|
|
|
}
|
|
|
);
|
|
|
- self.$set(self,'fullScreenType',true);
|
|
|
}
|
|
|
},
|
|
|
- //退出全屏
|
|
|
- outFullScreen() {
|
|
|
- let self = this;
|
|
|
- this.myPlugin.JS_FullScreenDisplay(false).then(
|
|
|
- (res) => {
|
|
|
- // console.info('JS_FullScreenDisplay success');
|
|
|
- // do you want...
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- // console.info('JS_FullScreenDisplay failed');
|
|
|
- // do you want...
|
|
|
- }
|
|
|
- );
|
|
|
- self.$set(self,'fullScreenType',false);
|
|
|
- },
|
|
|
initH5Player(split) {
|
|
|
this.myPlugin = new window.JSPlugin({
|
|
|
szId: this.videoData.id, //需要英文字母开头,唯一性,必填
|
|
@@ -181,9 +136,6 @@
|
|
|
return randomString
|
|
|
},
|
|
|
videoOff() {
|
|
|
- if(this.$parent.stopTime){
|
|
|
- document.addEventListener('fullscreenchange', this.fullFunction);
|
|
|
- }
|
|
|
this.myPlugin.JS_StopRealPlayAll().then(
|
|
|
() => {
|
|
|
// console.info('JS_StopRealPlayAll success')
|
|
@@ -227,19 +179,5 @@
|
|
|
z-index: 1;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
- .full-failed-button {
|
|
|
- background: url("../../assets/ZDimages/icon_0.png");
|
|
|
- background-size: 100%;
|
|
|
- position: fixed;
|
|
|
- font-size: 20px;
|
|
|
- height: 30px;
|
|
|
- width: 30px;
|
|
|
- line-height: 30px;
|
|
|
- text-align: center;
|
|
|
- bottom: 0;
|
|
|
- right: 0;
|
|
|
- z-index: 11;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|