@sdk185/sip-phone-sdk26 0.2.29 → 0.2.31

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": "@sdk185/sip-phone-sdk26",
3
- "version": "0.2.29",
3
+ "version": "0.2.31",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -2,7 +2,6 @@
2
2
  <template>
3
3
  <!-- 主容器:使用flex垂直布局,内容居中对齐 -->
4
4
  <div class="phone-nmain d-flex flex-column align-center justify-space-between sip-call-main">
5
-
6
5
  <!-- 位置信息显示区域 -->
7
6
  <div class="location-wrapper" v-if="showLocation">
8
7
  <!-- 显示经纬度和海拔信息 -->
@@ -100,14 +99,13 @@
100
99
  :active="false"
101
100
  class-name="elevation-6 video-panel"
102
101
  ref="remoteVideoWrapper"
103
- style="overflow: hidden !important;position: relative;left: 0;top: 0;"
102
+ style="overflow: hidden !important;"
104
103
  @mousedown.native="onLocalVideoDragCallback($event, 'remoteVideo')"
105
104
  >
106
105
  <v-btn v-if="miniMode" class="video-normal-mode" dark text x-small width="24" height="24" min-width="24" @click="onChangeVideoNormalModeBtnClick">
107
106
  <v-icon>mdi-arrow-bottom-right-bold-box</v-icon>
108
107
  </v-btn>
109
108
  <video
110
- id="remoteVideo"
111
109
  v-show="remoteVideo.show"
112
110
  autoplay="autoplay"
113
111
  webkit-playsinline="true"
@@ -121,14 +119,15 @@
121
119
  controls
122
120
  controlsList="nodownload nofullscreen noremoteplayback"
123
121
  disablepictureinpicture
122
+ @play="onRemoteVideoPlaying"
123
+ @loadedmetadata="onRemoteVideoLoaded"
124
124
  ></video>
125
- <div class="video-cover"></div>
126
125
  </vue-draggable-resizable>
127
126
  <!-- 本地视频窗口 -->
128
127
  <vue-draggable-resizable
129
128
  v-show="localVideo.show"
130
129
  :w="120"
131
- :h="230"
130
+ :h="260"
132
131
  :x="localVideo.x"
133
132
  :y="localVideo.y"
134
133
  :z="localVideo.z"
@@ -765,6 +764,18 @@ export default {
765
764
 
766
765
  return Promise.resolve(true)
767
766
  },
767
+ // 视频成功播放回调
768
+ onRemoteVideoPlaying() {
769
+ console.log('[iOS] Remote video is playing')
770
+ },
771
+
772
+ // 元数据加载完成回调
773
+ onRemoteVideoLoaded() {
774
+ console.log('[iOS] Remote video metadata loaded')
775
+ if (this.$refs.remoteVideo) {
776
+ this.$refs.remoteVideo.play().catch(() => {})
777
+ }
778
+ },
768
779
 
769
780
  startSip ({debug, password, register, autoDial = false}) {
770
781
  const {domain, port, path} = window.config
@@ -854,8 +865,51 @@ export default {
854
865
  // this.$refs.localVideo.srcObject = stream
855
866
  })
856
867
 
868
+ // this.sipMix.on('remoteStream', (stream, info) => {
869
+ // console.info('remoteStream', stream, info)
870
+ // this._resetCmpWHLRTB()
871
+
872
+ // Object.assign(this.localVideo, {
873
+ // w: parseInt(this.clientWidth / 3),
874
+ // h: parseInt(this.clientHeight / 3),
875
+ // x: 0,
876
+ // y: 80,
877
+ // z: 1100,
878
+ // draggable: true
879
+ // })
880
+ // this.$nextTick(() => {
881
+ // this.$refs.localVideoWrapper.moveVertically(80)
882
+ // })
883
+
884
+
885
+ // setTimeout(async () => {
886
+ // Object.assign(this.remoteVideo, {
887
+ // show: true,
888
+ // w: this.clientWidth,
889
+ // h: this.clientHeight,
890
+ // x: 0,
891
+ // y: 0,
892
+ // z: 1000,
893
+ // draggable: false
894
+ // })
895
+
896
+ // await this.$nextTick()
897
+ // if (this.autoHideLocalVideo) {
898
+ // this.localVideo.show = false
899
+ // }
900
+ // this.$refs.remoteVideo.srcObject = stream
901
+ // }, 500)
902
+
903
+ // })
904
+
857
905
  this.sipMix.on('remoteStream', (stream, info) => {
858
906
  console.info('remoteStream', stream, info)
907
+
908
+ const video = this.$refs.remoteVideo
909
+ if (!video) return
910
+
911
+ video.srcObject = stream
912
+
859
913
  this._resetCmpWHLRTB()
860
914
 
861
915
  Object.assign(this.localVideo, {
@@ -866,9 +920,36 @@ export default {
866
920
  z: 1100,
867
921
  draggable: true
868
922
  })
923
+
869
924
  this.$nextTick(() => {
870
- this.$refs.localVideoWrapper.moveVertically(80)
925
+ // ==================== 【iOS 16 纯前端强力修复】 ====================
926
+ const forcePlay = () => {
927
+ if (!video || video.paused || video.ended) {
928
+ const playPromise = video.play()
929
+ if (playPromise) {
930
+ playPromise.catch(err => {
931
+ console.warn('iOS force play failed:', err.name)
932
+ })
933
+ }
934
+ }
935
+ }
936
+
937
+ // 多重保险,覆盖 iOS 接通瞬间暂停状态
938
+ forcePlay()
939
+ setTimeout(forcePlay, 30)
940
+ setTimeout(forcePlay, 80)
941
+ setTimeout(forcePlay, 180)
942
+ setTimeout(forcePlay, 350)
943
+ setTimeout(forcePlay, 600)
944
+
945
+ // 持续监听,任何暂停立即恢复
946
+ video.addEventListener('pause', forcePlay, { once: false })
947
+
948
+ // 额外保护:元数据加载后再次强制播放
949
+ video.addEventListener('loadedmetadata', forcePlay, { once: true })
871
950
  })
951
+
952
+ // 原有后续代码
872
953
  setTimeout(async () => {
873
954
  Object.assign(this.remoteVideo, {
874
955
  show: true,
@@ -879,11 +960,11 @@ export default {
879
960
  z: 1000,
880
961
  draggable: false
881
962
  })
963
+
882
964
  await this.$nextTick()
883
965
  if (this.autoHideLocalVideo) {
884
966
  this.localVideo.show = false
885
967
  }
886
- this.$refs.remoteVideo.srcObject = stream;
887
968
  }, 500)
888
969
  })
889
970
 
@@ -1282,11 +1363,6 @@ export default {
1282
1363
  }
1283
1364
 
1284
1365
 
1285
- video::-webkit-media-controls {
1286
- opacity: 0 !important;
1287
- height: 0 !important;
1288
- pointer-events: none !important;
1289
- }
1290
1366
  video::-webkit-media-controls-volume-button {
1291
1367
  display: none !important;
1292
1368
  }
@@ -1302,6 +1378,22 @@ export default {
1302
1378
  video::-webkit-media-controls-live-button {
1303
1379
  display: none !important;
1304
1380
  }
1381
+ video::-webkit-media-controls {
1382
+ opacity: 0 !important;
1383
+ height: 0 !important;
1384
+ pointer-events: none !important;
1385
+ }
1386
+ /* iOS 16+ 纯前端压制中间暂停按钮 */
1387
+ video::-webkit-media-controls-overlay-play-button,
1388
+ video::-webkit-media-controls-start-playback-button,
1389
+ video::-webkit-media-controls-play-button,
1390
+ video::-webkit-media-controls-pause-button {
1391
+ display: none !important;
1392
+ opacity: 0 !important;
1393
+ pointer-events: none !important;
1394
+ visibility: hidden !important;
1395
+ }
1396
+
1305
1397
  /* 中间播放按钮 + 直播按钮 + 所有图标彻底隐藏 */
1306
1398
  video::-webkit-media-controls-overlay-play-button,
1307
1399
  video::-webkit-media-controls-start-playback-button,
@@ -1316,15 +1408,4 @@ export default {
1316
1408
  pointer-events: none !important;
1317
1409
  }
1318
1410
 
1319
- /* 🔥 全覆盖遮罩:所有按钮全部看不见、点不着 */
1320
- .video-cover {
1321
- position: absolute;
1322
- left: 0;
1323
- top: 0;
1324
- width: 100%;
1325
- height: 100%;
1326
- background: transparent;
1327
- z-index: 999999; /* 最高层级,盖住一切 */
1328
- pointer-events: none; /* 不影响视频点击 */
1329
- }
1330
1411
  </style>