@sdk185/sip-phone-sdk26 0.2.12 → 0.2.13

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.12",
3
+ "version": "0.2.13",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -145,10 +145,8 @@
145
145
  x-webkit-airplay="true"
146
146
  x5-video-player-type="h5"
147
147
  x5-video-orientation="h5"
148
- controlslist="nodownload nofullscreen"
149
- preload="metadata"
150
148
  ref="localVideo"
151
- style="object-fit: cover;"
149
+ style="pointer-events: none !important;"
152
150
  class="sip-call-video"
153
151
 
154
152
  ></video>
@@ -842,8 +840,8 @@ export default {
842
840
  if(this.localVideo.show) {
843
841
  return
844
842
  }
845
- this.localVideo.w = parseInt(this.clientWidth / 3)
846
- this.localVideo.h = parseInt(this.clientHeight / 3)
843
+ this.localVideo.w = this.clientWidth
844
+ this.localVideo.h = this.clientHeight
847
845
  this.localVideo.draggable = false
848
846
  this.showVideoCt = true
849
847
  this.localVideo.show = true
@@ -856,37 +854,56 @@ export default {
856
854
  console.info('remoteStream', stream, info)
857
855
  this._resetCmpWHLRTB()
858
856
 
857
+ // 修复:iOS remoteStream 事件优化
858
+ // 问题:iOS设备卡在localStream阶段,Android正常工作
859
+ // 解决方案:移除延迟,立即处理视频流
860
+
861
+ // 1. 立即绑定远程视频流(修复iOS卡顿问题)
862
+ // iOS需要立即绑定流来触发视频显示
863
+ this.$refs.remoteVideo.srcObject = stream
864
+
865
+ // 2. 调整本地视频到角落窗口(iOS和Android都优化)
866
+ // 将本地视频从全屏移动到左上角
859
867
  Object.assign(this.localVideo, {
860
- w: parseInt(this.clientWidth / 3),
861
- h: parseInt(this.clientHeight / 3),
862
- x: 0,
863
- y: 80,
864
- z: 1100,
865
- draggable: true
868
+ w: parseInt(this.clientWidth / 3), // 1/3 屏幕宽度
869
+ h: parseInt(this.clientHeight / 3), // 1/3 屏幕高度
870
+ x: 0, // 左侧位置
871
+ y: 80, // 顶部偏移(避免UI重叠)
872
+ z: 1100, // 前景层级
873
+ draggable: true // 启用拖拽
866
874
  })
867
- this.$nextTick(() => {
868
- this.$refs.localVideoWrapper.moveVertically(80)
875
+
876
+ // 3. 立即显示远程视频作为主视图(移除500ms延迟)
877
+ // 原来的setTimeout(500)导致iOS卡在localStream阶段
878
+ Object.assign(this.remoteVideo, {
879
+ show: true, // 显示远程视频
880
+ w: this.clientWidth, // 全屏宽度
881
+ h: this.clientHeight, // 全屏高度
882
+ x: 0, // 左侧位置
883
+ y: 0, // 顶部位置
884
+ z: 1000, // 背景层级
885
+ draggable: false // 禁用拖拽(主视图)
869
886
  })
870
887
 
871
-
872
- setTimeout(async () => {
873
- Object.assign(this.remoteVideo, {
874
- show: true,
875
- w: this.clientWidth,
876
- h: this.clientHeight,
877
- x: 0,
878
- y: 0,
879
- z: 1000,
880
- draggable: false
881
- })
882
-
883
- await this.$nextTick()
884
- if (this.autoHideLocalVideo) {
885
- this.localVideo.show = false
888
+ // 4. 应用布局更改并确保视频播放(iOS兼容性)
889
+ this.$nextTick(() => {
890
+ // 移动本地视频包装器到正确位置
891
+ this.$refs.localVideoWrapper.moveVertically(80)
892
+
893
+ // iOS:强制视频播放(iOS可能阻止自动播放)
894
+ // Android:play()会成功,无副作用
895
+ if (this.$refs.remoteVideo && this.$refs.remoteVideo.play) {
896
+ this.$refs.remoteVideo.play().catch(e => {
897
+ console.warn('iOS video play failed:', e)
898
+ // 即使播放失败也继续执行
899
+ })
886
900
  }
887
- this.$refs.remoteVideo.srcObject = stream
888
- }, 500)
901
+ })
889
902
 
903
+ // 5. 处理自动隐藏本地视频设置(逻辑不变)
904
+ if (this.autoHideLocalVideo) {
905
+ this.localVideo.show = false
906
+ }
890
907
  })
891
908
 
892
909
  this.sipMix.on('remoteRing', () => {
@@ -1284,27 +1301,6 @@ export default {
1284
1301
  }
1285
1302
 
1286
1303
 
1287
- /* iOS specific fixes */
1288
- @supports (-webkit-touch-callout: none) {
1289
- .sip-call-video {
1290
- -webkit-transform: translateZ(0);
1291
- transform: translateZ(0);
1292
- -webkit-backface-visibility: hidden;
1293
- backface-visibility: hidden;
1294
- -webkit-perspective: 1000;
1295
- perspective: 1000;
1296
- -webkit-user-select: none;
1297
- user-select: none;
1298
- -webkit-tap-highlight-color: transparent;
1299
- }
1300
-
1301
- /* Prevent iOS video from going fullscreen */
1302
- video[webkit-playsinline] {
1303
- -webkit-transform: scale(1);
1304
- transform: scale(1);
1305
- }
1306
- }
1307
-
1308
1304
  /* 隐藏音量按钮(可选) */
1309
1305
  video::-webkit-media-controls-volume-slider {
1310
1306
  display: none !important;