@sdk185/sip-phone-sdk26 0.2.30 → 0.2.32
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/dist/sip-phone-sdk.common.js +126 -47
- package/dist/sip-phone-sdk.css +1 -1
- package/dist/sip-phone-sdk.umd.js +126 -47
- package/dist/sip-phone-sdk.umd.min.js +5 -5
- package/package.json +1 -1
- package/src/components/MobilePhone.vue +106 -5
package/package.json
CHANGED
|
@@ -119,6 +119,8 @@
|
|
|
119
119
|
controls
|
|
120
120
|
controlsList="nodownload nofullscreen noremoteplayback"
|
|
121
121
|
disablepictureinpicture
|
|
122
|
+
@play="onRemoteVideoPlaying"
|
|
123
|
+
@loadedmetadata="onRemoteVideoLoaded"
|
|
122
124
|
></video>
|
|
123
125
|
</vue-draggable-resizable>
|
|
124
126
|
<!-- 本地视频窗口 -->
|
|
@@ -762,6 +764,18 @@ export default {
|
|
|
762
764
|
|
|
763
765
|
return Promise.resolve(true)
|
|
764
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
|
+
},
|
|
765
779
|
|
|
766
780
|
startSip ({debug, password, register, autoDial = false}) {
|
|
767
781
|
const {domain, port, path} = window.config
|
|
@@ -851,8 +865,51 @@ export default {
|
|
|
851
865
|
// this.$refs.localVideo.srcObject = stream
|
|
852
866
|
})
|
|
853
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
|
+
|
|
854
905
|
this.sipMix.on('remoteStream', (stream, info) => {
|
|
855
906
|
console.info('remoteStream', stream, info)
|
|
907
|
+
|
|
908
|
+
const video = this.$refs.remoteVideo
|
|
909
|
+
if (!video) return
|
|
910
|
+
|
|
911
|
+
video.srcObject = stream
|
|
912
|
+
|
|
856
913
|
this._resetCmpWHLRTB()
|
|
857
914
|
|
|
858
915
|
Object.assign(this.localVideo, {
|
|
@@ -863,11 +920,33 @@ export default {
|
|
|
863
920
|
z: 1100,
|
|
864
921
|
draggable: true
|
|
865
922
|
})
|
|
923
|
+
|
|
866
924
|
this.$nextTick(() => {
|
|
867
|
-
|
|
868
|
-
|
|
925
|
+
// ==================== iOS 16 优化后版本(减少延迟) ====================
|
|
926
|
+
const forcePlay = () => {
|
|
927
|
+
if (video.paused || video.ended) {
|
|
928
|
+
video.play().catch(err => {
|
|
929
|
+
console.warn('Force play failed:', err.name)
|
|
930
|
+
})
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// 更紧凑的调用顺序,减少延迟
|
|
935
|
+
forcePlay() // 立即
|
|
936
|
+
setTimeout(forcePlay, 30) // 30ms
|
|
937
|
+
setTimeout(forcePlay, 100) // 100ms
|
|
938
|
+
|
|
939
|
+
// 只监听一次,避免重复触发
|
|
940
|
+
video.addEventListener('pause', forcePlay, { once: true })
|
|
869
941
|
|
|
942
|
+
// 元数据加载完立即播放
|
|
943
|
+
video.addEventListener('loadedmetadata', () => {
|
|
944
|
+
console.log('[iOS] metadata loaded → force play')
|
|
945
|
+
forcePlay()
|
|
946
|
+
}, { once: true })
|
|
947
|
+
})
|
|
870
948
|
|
|
949
|
+
// 原有后续代码保持不变
|
|
871
950
|
setTimeout(async () => {
|
|
872
951
|
Object.assign(this.remoteVideo, {
|
|
873
952
|
show: true,
|
|
@@ -883,9 +962,7 @@ export default {
|
|
|
883
962
|
if (this.autoHideLocalVideo) {
|
|
884
963
|
this.localVideo.show = false
|
|
885
964
|
}
|
|
886
|
-
|
|
887
|
-
}, 500)
|
|
888
|
-
|
|
965
|
+
}, 300) // 稍微调小一点
|
|
889
966
|
})
|
|
890
967
|
|
|
891
968
|
this.sipMix.on('remoteRing', () => {
|
|
@@ -1303,5 +1380,29 @@ export default {
|
|
|
1303
1380
|
height: 0 !important;
|
|
1304
1381
|
pointer-events: none !important;
|
|
1305
1382
|
}
|
|
1383
|
+
/* iOS 16+ 纯前端压制中间暂停按钮 */
|
|
1384
|
+
video::-webkit-media-controls-overlay-play-button,
|
|
1385
|
+
video::-webkit-media-controls-start-playback-button,
|
|
1386
|
+
video::-webkit-media-controls-play-button,
|
|
1387
|
+
video::-webkit-media-controls-pause-button {
|
|
1388
|
+
display: none !important;
|
|
1389
|
+
opacity: 0 !important;
|
|
1390
|
+
pointer-events: none !important;
|
|
1391
|
+
visibility: hidden !important;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
/* 中间播放按钮 + 直播按钮 + 所有图标彻底隐藏 */
|
|
1395
|
+
video::-webkit-media-controls-overlay-play-button,
|
|
1396
|
+
video::-webkit-media-controls-start-playback-button,
|
|
1397
|
+
video::-webkit-media-controls-live-button,
|
|
1398
|
+
video::-webkit-full-screen-button,
|
|
1399
|
+
video::-webkit-media-controls-panel {
|
|
1400
|
+
display: none !important;
|
|
1401
|
+
opacity: 0 !important;
|
|
1402
|
+
visibility: hidden !important;
|
|
1403
|
+
width: 0 !important;
|
|
1404
|
+
height: 0 !important;
|
|
1405
|
+
pointer-events: none !important;
|
|
1406
|
+
}
|
|
1306
1407
|
|
|
1307
1408
|
</style>
|