askbot-dragon 1.7.89-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 +39 -23
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,30 +69,21 @@
|
|
|
64
69
|
/* 安卓手机播放视频默认全屏设置 ios默认就是全屏 */
|
|
65
70
|
let id = this.msg.id + 'key'
|
|
66
71
|
const video = document.getElementById(id);
|
|
67
|
-
|
|
72
|
+
let containerId = 'dragon-video' + this.msg.id
|
|
73
|
+
const videoContainer = document.getElementById(containerId);
|
|
68
74
|
// 仅在 Android 设备尝试自动全屏
|
|
69
75
|
const isAndroid = /Android/i.test(navigator.userAgent);
|
|
70
76
|
if (isAndroid){
|
|
71
|
-
video.addEventListener('play',
|
|
77
|
+
video.addEventListener('play', () => {
|
|
72
78
|
// 仅在全屏请求由用户触发时有效(如点击播放按钮后)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
await video.requestFullscreen();
|
|
76
|
-
|
|
77
|
-
// 2. 锁定竖屏方向(需浏览器支持)
|
|
78
|
-
if (screen.orientation?.lock) {
|
|
79
|
-
await screen.orientation.lock('portrait');
|
|
80
|
-
}
|
|
81
|
-
} catch (err) {
|
|
82
|
-
console.error('全屏失败:', err);
|
|
83
|
-
videoContainer.classList.add('force-fullscreen'); // 降级方案
|
|
84
|
-
}
|
|
79
|
+
videoContainer.classList.add('force-fullscreen'); // 降级方案
|
|
80
|
+
this.isFullscreen = true;
|
|
85
81
|
});
|
|
86
82
|
// 点击关闭按钮或按 ESC 退出
|
|
87
83
|
document.addEventListener('fullscreenchange', () => {
|
|
88
84
|
if (!document.fullscreenElement) {
|
|
89
|
-
console.debug('fullscreenchange')
|
|
90
85
|
videoContainer.classList.remove('force-fullscreen');
|
|
86
|
+
this.isFullscreen = false;
|
|
91
87
|
}
|
|
92
88
|
});
|
|
93
89
|
}
|
|
@@ -148,14 +144,20 @@
|
|
|
148
144
|
return new File([u8arr], filename, {type:mime});
|
|
149
145
|
//转换成成blob对象
|
|
150
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');
|
|
151
153
|
}
|
|
152
|
-
}
|
|
154
|
+
}
|
|
153
155
|
|
|
154
156
|
}
|
|
155
157
|
</script>
|
|
156
158
|
<style scoped lang="less">
|
|
157
159
|
video::-webkit-media-controls-mute-button { display: none !important;}
|
|
158
|
-
|
|
160
|
+
.dragon-video{
|
|
159
161
|
position: relative;
|
|
160
162
|
width: calc(100vw - 109px);
|
|
161
163
|
max-width: 260px;
|
|
@@ -199,10 +201,24 @@ video::-webkit-media-controls-mute-button { display: none !important;}
|
|
|
199
201
|
object-fit: contain !important;
|
|
200
202
|
background: black !important;
|
|
201
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
|
+
}
|
|
202
222
|
}
|
|
203
223
|
|
|
204
|
-
/* 隐藏原生控件(可选) */
|
|
205
|
-
.force-fullscreen::-webkit-media-controls {
|
|
206
|
-
display: none !important;
|
|
207
|
-
}
|
|
208
224
|
</style>
|