Skip to content

Commit

Permalink
Merged in maintenance/expand-functionality (pull request #3)
Browse files Browse the repository at this point in the history
Maintenance/expand functionality

Approved-by: Tom Van Laerhoven
Approved-by: George Choustoulakis
  • Loading branch information
Jeroen-Veltmans committed May 8, 2023
2 parents 99dd4b2 + 5a9d2fb commit 21ac714
Show file tree
Hide file tree
Showing 12 changed files with 343 additions and 144 deletions.
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.1.4] - 2023-04-26

### Fixed

- Fixed an issue where a session could be created without a source.

## [1.1.3] - 2023-04-20

### Changed

- Made THEOplayer an external dependency.

## [1.1.2] - 2023-04-14

### Fixed

- Fixed passing content length for a live stream or on early error.

## [1.1.1] - 2023-04-07

### Changed

- Updated THEOplayer version to 5.X.

## [1.1.0] - 2023-03-30

### Added

- Added `setContentInfo` to pass video metadata during playback.
- Added `setAdInfo` to pass ad metadata during playback.
- Added `reportPlaybackFailed` to notify Conviva of non-video errors.
- Added `stopAndStartNewSession` to enable explicitly stopping the current session and starting a new one.
- Added visibility change reporting.

### Changed

- Updated THEOplayer version to 4.X.
- Improved error handling.
- Improved default metadata.

### Fixed

- Fixed handling a replay of the same source.

## [1.0.0] - 2022-08-03

Initial release
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@theoplayer/conviva-connector-web",
"version": "1.0.0",
"version": "1.1.4",
"description": "A connector implementing Conviva for web.",
"main": "dist/conviva-connector.umd.js",
"repository": "https://github.com/THEOplayer/conviva-connector-web",
Expand Down Expand Up @@ -32,6 +32,7 @@
"license": "MIT",
"files": [
"dist/",
"CHANGELOG.md",
"README.md",
"package.json"
],
Expand All @@ -56,14 +57,14 @@
"rollup": "^2.33.2",
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-terser": "^7.0.2",
"theoplayer": "^3.5.0",
"theoplayer": "^5.0.0",
"ts-jest": "^28.0.5",
"ts-node": "^10.8.2",
"tslib": "^2.4.0",
"typescript": "^4.0.5"
},
"peerDependencies": {
"theoplayer": "^3.5.0",
"theoplayer": "^5.0.0",
"@theoplayer/yospace-connector-web": "1.2.0"
},
"peerDependenciesMeta": {
Expand All @@ -72,6 +73,6 @@
}
},
"dependencies": {
"@convivainc/conviva-js-coresdk": "^4.5.8"
"@convivainc/conviva-js-coresdk": "^4.6.1"
}
}
4 changes: 3 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ const options = [
format: 'esm',
indent: false,
banner
}
},
],
external: ['theoplayer'],
plugins: [
nodeResolve({
extensions: ['.ts', '.js']
Expand All @@ -63,6 +64,7 @@ const options = [
footer: `export as namespace ${globalName};`
}
],
external: ['theoplayer'],
plugins: [
dts({
tsconfig: 'tsconfig.json'
Expand Down
42 changes: 38 additions & 4 deletions src/integration/ConvivaConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,57 @@ import { YospaceConnector } from '@theoplayer/yospace-connector-web';
import { ConvivaConfiguration, ConvivaHandler } from './ConvivaHandler';

export class ConvivaConnector {
private player: ChromelessPlayer;

private convivaHandler: ConvivaHandler;

constructor(player: ChromelessPlayer, convivaMetadata: ConvivaMetadata, convivaConfig: ConvivaConfiguration) {
this.player = player;
this.convivaHandler = new ConvivaHandler(player, convivaMetadata, convivaConfig);
}

/**
* Optionally connects the ConvivaConnector to the YospaceConnector to report SSAI.
* @param connector the YospaceConnector
*/
connect(connector: YospaceConnector) {
connect(connector: YospaceConnector): void {
this.convivaHandler.connect(connector);
}

/**
* Sets Conviva metadata on the Conviva video analytics.
* @param metadata object of key value pairs
*/
setContentInfo(metadata: ConvivaMetadata): void {
this.convivaHandler.setContentInfo(metadata);
}

/**
* Sets Conviva metadata on the Conviva ad analytics.
* @param metadata object of key value pairs
*/
setAdInfo(metadata: ConvivaMetadata): void {
this.convivaHandler.setAdInfo(metadata);
}

/**
* Reports an error to the Conviva session and closes the session.
* @param errorMessage string explaining what the error is.
*/
reportPlaybackFailed(errorMessage: string): void {
this.convivaHandler.reportPlaybackFailed(errorMessage);
}

/**
* Explicitly stop the current session and start a new one.
*
* This can be used to manually mark the start of a new session during a live stream,
* for example when a new program starts.
* By default, new sessions are only started on play-out of a new source, or for an ad break.
*
* @param metadata object of key value pairs.
*/
stopAndStartNewSession(metadata: ConvivaMetadata): void {
this.convivaHandler.stopAndStartNewSession(metadata);
}

/**
* Stops video and ad analytics and closes all sessions.
*/
Expand Down
Loading

0 comments on commit 21ac714

Please sign in to comment.