Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/web_player.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ export class WebPlayer {
*/
activeStreamId;

resyncTriggered;


constructor(configOrWindow, containerElement, placeHolderElement) {

Expand Down Expand Up @@ -423,6 +425,7 @@ export class WebPlayer {
this.isIPCamera = false;
this.playerEvents = WebPlayer.PLAYER_EVENTS
this.backupStreamId = null;
this.resyncTriggered = false;
}

initializeFromUrlParams() {
Expand Down Expand Up @@ -585,7 +588,12 @@ export class WebPlayer {
else if (infos["obj"].state == "failed" || infos["obj"].state == "disconnected" || infos["obj"].state == "closed") {
//
Logger.warn("Ice connection is not connected. tryNextTech to replay");
this.tryNextTech();
if(this.resyncTriggered) {
this.resyncTriggered = false;
}
else {
this.tryNextTech();
}
}

}
Expand Down Expand Up @@ -696,6 +704,13 @@ export class WebPlayer {
this.handleWebRTCInfoMessages(infos);
});

this.videojsPlayer.on('auto-resync-triggered', (event, infos) => {
Logger.info("*************************************************");
Logger.warn("auto-resync-triggered callback: " + JSON.stringify(infos));
this.resyncTriggered = true;
this.playerListener("auto-resync-triggered", infos);
});


this.videojsPlayer.on('webrtc-error', (event, errors) => {
//some of the possible errors, NotFoundError, SecurityError,PermissionDeniedError
Expand Down