@sdk185/sip-phone-sdk26 0.2.13 → 0.2.14

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.13",
3
+ "version": "0.2.14",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -840,9 +840,17 @@ export default {
840
840
  if(this.localVideo.show) {
841
841
  return
842
842
  }
843
- this.localVideo.w = this.clientWidth
844
- this.localVideo.h = this.clientHeight
845
- this.localVideo.draggable = false
843
+
844
+ // 修复:在第一阶段就设置好本地视频位置和大小
845
+ // 参考 onChangeVideoFullScreenBtnClick 的方式,直接写死位置
846
+ // 避免 iOS 设备卡在第一阶段的问题
847
+ this.localVideo.w = parseInt(this.clientWidth / 3) // 1/3 屏幕宽度
848
+ this.localVideo.h = parseInt(this.clientHeight / 3) // 1/3 屏幕高度
849
+ this.localVideo.x = 0 // 左侧位置
850
+ this.localVideo.y = 80 // 顶部偏移(避免UI重叠)
851
+ this.localVideo.z = 1100 // 前景层级
852
+ this.localVideo.draggable = true // 启用拖拽
853
+
846
854
  this.showVideoCt = true
847
855
  this.localVideo.show = true
848
856
 
@@ -854,56 +862,37 @@ export default {
854
862
  console.info('remoteStream', stream, info)
855
863
  this._resetCmpWHLRTB()
856
864
 
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
- // 将本地视频从全屏移动到左上角
867
865
  Object.assign(this.localVideo, {
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 // 启用拖拽
874
- })
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 // 禁用拖拽(主视图)
866
+ w: parseInt(this.clientWidth / 3),
867
+ h: parseInt(this.clientHeight / 3),
868
+ x: 0,
869
+ y: 80,
870
+ z: 1100,
871
+ draggable: true
886
872
  })
887
-
888
- // 4. 应用布局更改并确保视频播放(iOS兼容性)
889
873
  this.$nextTick(() => {
890
- // 移动本地视频包装器到正确位置
891
874
  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
- })
900
- }
901
875
  })
902
876
 
903
- // 5. 处理自动隐藏本地视频设置(逻辑不变)
904
- if (this.autoHideLocalVideo) {
905
- this.localVideo.show = false
906
- }
877
+
878
+ setTimeout(async () => {
879
+ Object.assign(this.remoteVideo, {
880
+ show: true,
881
+ w: this.clientWidth,
882
+ h: this.clientHeight,
883
+ x: 0,
884
+ y: 0,
885
+ z: 1000,
886
+ draggable: false
887
+ })
888
+
889
+ await this.$nextTick()
890
+ if (this.autoHideLocalVideo) {
891
+ this.localVideo.show = false
892
+ }
893
+ this.$refs.remoteVideo.srcObject = stream
894
+ }, 500)
895
+
907
896
  })
908
897
 
909
898
  this.sipMix.on('remoteRing', () => {