askbot-dragon 1.7.90-beta → 1.7.92-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.7.90-beta",
3
+ "version": "1.7.92-beta",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -3,7 +3,7 @@
3
3
  v-loading="loading"
4
4
  :element-loading-text="showProgress"
5
5
  class="dragon-video"
6
- :id="'dragon-video' + msg.id"
6
+ :id="'dragon-video' + msg.msgId"
7
7
  >
8
8
  <!-- <video-player
9
9
  class="video-player vjs-custom-skin"
@@ -13,14 +13,14 @@
13
13
  /> -->
14
14
  <video
15
15
  controls="controls"
16
- :controlslist="nodownload&&'nodownload'"
16
+ :controlslist="controlAttributes"
17
17
  :raw-controls="true"
18
18
  x5-video-player-type="h5-page"
19
19
  style="object-fit: contain;width: calc(100vw - 139px);height: 160px;background-color: black;border-radius: 10px;max-width: 230px;padding-left: 10px"
20
20
  preload
21
21
  :poster="videoSrc+'?spm=qipa250&x-oss-process=video/snapshot,t_1000,f_jpg,w_0,h_0,m_fast'"
22
22
  class="video-player vjs-custom-skin"
23
- :id="msg.id+'key'">
23
+ :id="msg.msgId+'key'">
24
24
  <source :src="videoSrc"/>
25
25
  </video>
26
26
  <div v-if="isFullscreen" class="close-fullscreen" @click="closeFullScreen">
@@ -42,7 +42,8 @@
42
42
  return {
43
43
  videoSrc:'',
44
44
  poster:'',
45
- isFullscreen:false
45
+ isFullscreen:false,
46
+ isAndroid:false
46
47
  }
47
48
  },
48
49
  watch: {
@@ -56,6 +57,13 @@
56
57
  },
57
58
  src() {
58
59
  return this.url ? this.url : this.localUrl;
60
+ },
61
+ controlAttributes(){
62
+ /* 安卓手机自定义了全屏样式,所以禁掉原生的全屏 */
63
+ const attributes = []
64
+ if (this.isAndroid) attributes.push('nofullscreen')
65
+ if (this.nodownload&&'nodownload') attributes.push('nodownload')
66
+ return attributes.join(' ')
59
67
  }
60
68
  },
61
69
  mounted() {
@@ -67,12 +75,13 @@
67
75
  this.poster = this.videoSrc+'?spm=qipa250&x-oss-process=video/snapshot,t_1000,f_jpg,w_0,h_0,m_fast'
68
76
  console.debug('poster',this.poster)
69
77
  /* 安卓手机播放视频默认全屏设置 ios默认就是全屏 */
70
- let id = this.msg.id + 'key'
78
+ let id = this.msg.msgId + 'key'
71
79
  const video = document.getElementById(id);
72
- let containerId = 'dragon-video' + this.msg.id
80
+ let containerId = 'dragon-video' + this.msg.msgId
73
81
  const videoContainer = document.getElementById(containerId);
74
82
  // 仅在 Android 设备尝试自动全屏
75
83
  const isAndroid = /Android/i.test(navigator.userAgent);
84
+ this.isAndroid = isAndroid;
76
85
  if (isAndroid){
77
86
  video.addEventListener('play', () => {
78
87
  // 仅在全屏请求由用户触发时有效(如点击播放按钮后)
@@ -147,7 +156,7 @@
147
156
  },
148
157
  closeFullScreen(){
149
158
  this.isFullscreen = false;
150
- let containerId = 'dragon-video' + this.msg.id
159
+ let containerId = 'dragon-video' + this.msg.msgId
151
160
  const videoContainer = document.getElementById(containerId);
152
161
  videoContainer.classList.remove('force-fullscreen');
153
162
  }