Skip to content

Commit

Permalink
Remove runtime dependency on Yospace connector
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Apr 8, 2024
1 parent 1991dff commit 7731b8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion conviva/src/integration/ads/YospaceAdReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export class YospaceAdReporter {
};

private readonly onYospaceSessionError = (code: SessionErrorCode) => {
if (code === SessionErrorCode.TIMEOUT) {
const yospaceCode = code as number as YospaceSessionErrorCode;
if (yospaceCode === YospaceSessionErrorCode.TIMEOUT) {
this.convivaVideoAnalytics.reportPlaybackError('The Yospace session has timed out.');
} else {
this.convivaVideoAnalytics.reportPlaybackError('The Yospace session has errored.');
Expand All @@ -121,3 +122,8 @@ export class YospaceAdReporter {
this.yospaceConnector.unregisterAnalyticEventObserver(this.observer);
}
}

// Keep this in sync with SessionErrorCode from yospace-connector-web
enum YospaceSessionErrorCode {
TIMEOUT = 0
}
3 changes: 2 additions & 1 deletion yospace/src/yospace/AnalyticEventObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { AdBreak, AdVert } from './AdBreak';
import { TrackingError } from './TrackingError';
import { YospaceSessionManager } from './YospaceSessionManager';

// Keep this in sync with YospaceSessionErrorCode from conviva-connector-web
export enum SessionErrorCode {
TIMEOUT
TIMEOUT = 0
}

export interface AnalyticEventObserver {
Expand Down

0 comments on commit 7731b8e

Please sign in to comment.