senza-sdk 4.2.56 → 4.2.58-a3e6d19.0
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/bundle.js +1 -1
- package/package.json +1 -1
- package/src/deviceManager.js +1 -2
- package/src/senzaShakaPlayer.js +21 -8
package/package.json
CHANGED
package/src/deviceManager.js
CHANGED
|
@@ -56,7 +56,6 @@ class DeviceManager extends EventTarget {
|
|
|
56
56
|
*
|
|
57
57
|
*/
|
|
58
58
|
typeof document !== "undefined" && document.addEventListener("wifiSignalReport", (e) => {
|
|
59
|
-
sdkLogger.log("Got wifiSignalReport", JSON.stringify(e.detail));
|
|
60
59
|
wifiInfo.level = e.detail.level;
|
|
61
60
|
wifiInfo.quality = e.detail.quality;
|
|
62
61
|
wifiInfo.ssid = e.detail.ssid;
|
|
@@ -86,7 +85,7 @@ class DeviceManager extends EventTarget {
|
|
|
86
85
|
connectionId: sessionInfoObj.connectionId,
|
|
87
86
|
community: sessionInfoObj.community,
|
|
88
87
|
tenant: sessionInfoObj.tenant,
|
|
89
|
-
clientIp: sessionInfoObj.clientIp,
|
|
88
|
+
clientIp: sessionInfoObj?.settings?.["ui-streamer"]?.clientIpOverride || sessionInfoObj.clientIp,
|
|
90
89
|
countryCode: sessionInfoObj.general?.location?.["x-country-code"],
|
|
91
90
|
connectionType: (!sessionInfoObj.connectionType || sessionInfoObj.connectionType === "direct") ? "device" : sessionInfoObj.connectionType
|
|
92
91
|
};
|
package/src/senzaShakaPlayer.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as shaka from "shaka-player";
|
|
2
2
|
import { remotePlayer, lifecycle, getPlatformInfo } from "./api";
|
|
3
3
|
import { sdkLogger, iso6393to1 } from "./utils";
|
|
4
|
-
|
|
5
4
|
// Define custom error category
|
|
6
5
|
shaka.util.Error.Category.SENZA_PLAYER_ERROR = 50;
|
|
7
6
|
shaka.util.Error.Code.SENZA_PLAYER_ERROR = 10500;
|
|
@@ -76,13 +75,6 @@ export class SenzaShakaPlayer extends shaka.Player {
|
|
|
76
75
|
* @description Object containing event listeners for the video element.
|
|
77
76
|
*/
|
|
78
77
|
_videoEventListeners = {
|
|
79
|
-
"play": () => {
|
|
80
|
-
this.remotePlayer.play()
|
|
81
|
-
.catch(error => {
|
|
82
|
-
sdkLogger.error("Failed to play remote player:", error);
|
|
83
|
-
this.handleSenzaError(error.code, error.message || "Unknown play error");
|
|
84
|
-
});
|
|
85
|
-
},
|
|
86
78
|
"pause": () => {
|
|
87
79
|
this.remotePlayer.pause()
|
|
88
80
|
.catch(error => {
|
|
@@ -219,6 +211,7 @@ export class SenzaShakaPlayer extends shaka.Player {
|
|
|
219
211
|
* @param {boolean} [initializeMediaSource=true] - Whether to initialize the media source.
|
|
220
212
|
*/
|
|
221
213
|
async attach(videoElement, initializeMediaSource = true) {
|
|
214
|
+
|
|
222
215
|
await super.attach(videoElement, initializeMediaSource);
|
|
223
216
|
this.videoElement = videoElement;
|
|
224
217
|
this._attachVideoElementToRemotePlayer();
|
|
@@ -582,6 +575,26 @@ export class SenzaShakaPlayer extends shaka.Player {
|
|
|
582
575
|
for (const [event, listener] of Object.entries(this._videoEventListeners)) {
|
|
583
576
|
this.videoElement.addEventListener(event, listener);
|
|
584
577
|
}
|
|
578
|
+
|
|
579
|
+
this.videoElement.origPlay=this.videoElement.play;
|
|
580
|
+
this.videoElement.play = async () => {
|
|
581
|
+
sdkLogger.info("video tag play was called - first calling remotePlayer Play");
|
|
582
|
+
|
|
583
|
+
try {
|
|
584
|
+
await this.remotePlayer.play();
|
|
585
|
+
} catch (error) {
|
|
586
|
+
sdkLogger.error("Failed to play remote player:", error);
|
|
587
|
+
this.handleSenzaError(error.code, error.message || "Unknown play error");
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
sdkLogger.info("Waiting for 30 seconds");
|
|
591
|
+
setTimeout(() => {
|
|
592
|
+
sdkLogger.info("Now calling origPlay");
|
|
593
|
+
return this.videoElement.origPlay();
|
|
594
|
+
}, 30 * 1000);
|
|
595
|
+
|
|
596
|
+
};
|
|
597
|
+
|
|
585
598
|
}
|
|
586
599
|
|
|
587
600
|
}
|