askbot-dragon 1.7.88-beta → 1.7.90-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/askVideo.vue +53 -5
package/package.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
<div
|
|
3
3
|
v-loading="loading"
|
|
4
4
|
:element-loading-text="showProgress"
|
|
5
|
-
|
|
5
|
+
class="dragon-video"
|
|
6
|
+
:id="'dragon-video' + msg.id"
|
|
6
7
|
>
|
|
7
8
|
<!-- <video-player
|
|
8
9
|
class="video-player vjs-custom-skin"
|
|
@@ -22,6 +23,9 @@
|
|
|
22
23
|
:id="msg.id+'key'">
|
|
23
24
|
<source :src="videoSrc"/>
|
|
24
25
|
</video>
|
|
26
|
+
<div v-if="isFullscreen" class="close-fullscreen" @click="closeFullScreen">
|
|
27
|
+
<i class="iconfont guoran-tongyichicun-guanbi2"></i>
|
|
28
|
+
</div>
|
|
25
29
|
<div v-show="!nodownload" class="dragon-video-download">
|
|
26
30
|
<a :href="msg.content.url" download><span class="el-icon-download"></span></a>
|
|
27
31
|
</div>
|
|
@@ -37,7 +41,8 @@
|
|
|
37
41
|
data() {
|
|
38
42
|
return {
|
|
39
43
|
videoSrc:'',
|
|
40
|
-
poster:''
|
|
44
|
+
poster:'',
|
|
45
|
+
isFullscreen:false
|
|
41
46
|
}
|
|
42
47
|
},
|
|
43
48
|
watch: {
|
|
@@ -64,13 +69,21 @@
|
|
|
64
69
|
/* 安卓手机播放视频默认全屏设置 ios默认就是全屏 */
|
|
65
70
|
let id = this.msg.id + 'key'
|
|
66
71
|
const video = document.getElementById(id);
|
|
72
|
+
let containerId = 'dragon-video' + this.msg.id
|
|
73
|
+
const videoContainer = document.getElementById(containerId);
|
|
67
74
|
// 仅在 Android 设备尝试自动全屏
|
|
68
75
|
const isAndroid = /Android/i.test(navigator.userAgent);
|
|
69
76
|
if (isAndroid){
|
|
70
77
|
video.addEventListener('play', () => {
|
|
71
78
|
// 仅在全屏请求由用户触发时有效(如点击播放按钮后)
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
videoContainer.classList.add('force-fullscreen'); // 降级方案
|
|
80
|
+
this.isFullscreen = true;
|
|
81
|
+
});
|
|
82
|
+
// 点击关闭按钮或按 ESC 退出
|
|
83
|
+
document.addEventListener('fullscreenchange', () => {
|
|
84
|
+
if (!document.fullscreenElement) {
|
|
85
|
+
videoContainer.classList.remove('force-fullscreen');
|
|
86
|
+
this.isFullscreen = false;
|
|
74
87
|
}
|
|
75
88
|
});
|
|
76
89
|
}
|
|
@@ -131,6 +144,12 @@
|
|
|
131
144
|
return new File([u8arr], filename, {type:mime});
|
|
132
145
|
//转换成成blob对象
|
|
133
146
|
/*return new Blob([u8arr],{type:'image/png'});*/
|
|
147
|
+
},
|
|
148
|
+
closeFullScreen(){
|
|
149
|
+
this.isFullscreen = false;
|
|
150
|
+
let containerId = 'dragon-video' + this.msg.id
|
|
151
|
+
const videoContainer = document.getElementById(containerId);
|
|
152
|
+
videoContainer.classList.remove('force-fullscreen');
|
|
134
153
|
}
|
|
135
154
|
}
|
|
136
155
|
|
|
@@ -138,7 +157,7 @@
|
|
|
138
157
|
</script>
|
|
139
158
|
<style scoped lang="less">
|
|
140
159
|
video::-webkit-media-controls-mute-button { display: none !important;}
|
|
141
|
-
|
|
160
|
+
.dragon-video{
|
|
142
161
|
position: relative;
|
|
143
162
|
width: calc(100vw - 109px);
|
|
144
163
|
max-width: 260px;
|
|
@@ -172,5 +191,34 @@ video::-webkit-media-controls-mute-button { display: none !important;}
|
|
|
172
191
|
}
|
|
173
192
|
}
|
|
174
193
|
}
|
|
194
|
+
/* 强制竖屏全屏样式 */
|
|
195
|
+
.force-fullscreen {
|
|
196
|
+
position: fixed !important;
|
|
197
|
+
top: 0 !important;
|
|
198
|
+
left: 0 !important;
|
|
199
|
+
width: 100vw !important;
|
|
200
|
+
height: 100vh !important;
|
|
201
|
+
object-fit: contain !important;
|
|
202
|
+
background: black !important;
|
|
203
|
+
z-index: 9999 !important;
|
|
204
|
+
max-width: 100vw!important;
|
|
205
|
+
display: flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
justify-content: center;
|
|
208
|
+
video{
|
|
209
|
+
max-width: 100% !important;
|
|
210
|
+
width: 100% !important;
|
|
211
|
+
height: 100% !important;
|
|
212
|
+
}
|
|
213
|
+
.close-fullscreen{
|
|
214
|
+
position: absolute;
|
|
215
|
+
top: 10px;
|
|
216
|
+
right: 10px;
|
|
217
|
+
i{
|
|
218
|
+
color: #ffffff;
|
|
219
|
+
font-size: 20px;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
175
223
|
|
|
176
224
|
</style>
|