This is an open-source project to enable the use of a third-party component (Yospace) with the Bitmovin Player Web SDK.
This project is not part of a regular maintenance or update schedule. For any update requests, please take a look at the guidance further below.
As an open-source project, we are pleased to accept any and all changes, updates and fixes from the community wishing to use this project. Please see CONTRIBUTING.md for more details on how to contribute.
If you come across a bug related to the player, please raise this through your support ticketing system.
Should you want some help updating this project (update, modify, fix or otherwise) and can't contribute for any reason, please raise your request to your Bitmovin account team, who can discuss your request.
As an open-source project and not a core product offering, any request, issue or query related to this project is excluded from any SLA and Support terms that a customer might have with either Bitmovin or another third-party service provider or Company contributing to this project. Any and all updates are purely at the contributor's discretion.
Thank you for your contributions!
This integration completely encapsulates the usage of Yospace. After creating the player it can be used like a normal Bitmovin Player instance.
- Following the instructions on Yospace Developer 6.4 Step 1 to add Yospace's private npm registry to your setup
- Run
npm install - Run
npm start
- Install the Yospace Ad Management SDK:
npm i -S @yospace/admanagement-sdk- Hint: Yospace uses a private NPM registry and you need log in using an
authTokenspecific to your user account. Instructions:
- Go to https://yospacerepo.jfrog.io/
- Click on the User Menu at the very top right
- Click
Set Me Upin the menu - Choose
NPM - Click
Search for Repositoryand selectjavascript-sdkorjavascript-sdk-release - Click the
Generate Token & Create Instructionsbutton. This will show you all the required details.
- Hint: Yospace uses a private NPM registry and you need log in using an
- Install the Bitmovin Player Yospace Integration:
npm i -S @bitmovin/player-integration-yospace - Import the
BitmovinYospacePlayerinto your code:import { BitmovinYospacePlayer } from '@bitmovin/player-integration-yospace'; - Import the Bitmovin
Playercore into your code:import { Player } from 'bitmovin-player/modules/bitmovinplayer-core'; - Add the relevant Bitmovin Player modules to the
Playerobject using the staticPlayer.addModule(...)API. Please note thatbitmovinplayer-advertising-coreandbitmovinplayer-advertising-bitmovinare required by this integration and must be provided. - Create a new player instance, and pass the
BitmovinPlayerStaticAPIto it:new BitmovinYospacePlayer(Player, container, config) - Load a
YospaceSourceConfigwith your Yospace HLS/DASH URL. It's aPlayerConfigwith Yospace-specific extension. Most important extension is theassetType, which needs to be set. In addition, HLS is picked before DASH, so if the user wants to play a dash stream the hls config has to be omitted.
const playerConfig: PlayerConfig = {
key: 'YOUR-PLAYER-KEY',
};
const playerContainer = document.getElementById('player');
const bitmovinYospacePlayer = new BitmovinYospacePlayer(Player, playerContainer, playerConfig);
// Create the UI afterwards (see https://github.com/bitmovin/bitmovin-player-ui for details)
const uiManager = UIFactory.buildDefaultUI(player);
// Load a new yospace source
const source: YospaceSourceConfig = {
// omit 'hls' field if dash stream is intended
hls: 'your yospace url',
dash: 'your yospace url',
// The type of the asset, can be imported: `import { YospaceAssetType } from '@bitmovin/player-integration-yospace';`
assetType: YospaceAssetType.VOD,
// one of:
// - bitmovin.player.ads.yospace.YospaceAssetType.LINEAR
// - bitmovin.player.ads.yospace.YospaceAssetType.VOD
};
bitmovinYospacePlayer.load(source);As there can be different rules for different use-cases we provide a BitmovinYospacePlayerPolicy interface which can be implemented.
In this policy you can define which actions should be allowed during playback.
You can set the policy right after initialization by calling:
bitmovinYospacePlayer.setPolicy(...); // pass in your policy object which implements BitmovinYospacePlayerPolicyWe also provide a default policy.
See BitmovinYospacePlayerPolicy for more details.
You can pass a third optional parameter to the player constructor:
const yospaceConfig: YospaceConfiguration = {
debug: true,
};
// ...
const bitmovinYospacePlayer = new BitmovinYospacePlayer(Player, playerContainer, conf, yospaceConfig);- Include the following Tweaks to the PlayerConfig:
tweaks: {
...
file_protocol : true, // Required if app is being loaded from file system
app_id : "Ff4zhu5kqV.TizenBitmovinPlayerAppMode" // This should be your Tizen App Id which needs to be allow-listed in Player License and optionally, Analytics License
}
- Make sure the app_id is allow-listed in your Player's License
- In the
YospaceConfigset the paramYospaceConfig.disableServiceWorkertotrue - In the
YospaceConfigset the paramYospaceConfig.useTizentotrue
// Yospace configuration
const yospaceConfig = {
...
disableServiceWorker: true, // Disable Service Worker for Tizen Web App use
useTizen: true,
};- Run
npm run build-tv - Import the
tizenfolder (as General -> Existing Project) into Tizen Studio and run as a Tizen Web Application, or open the folder in Visual Studio Code with the tizen-tv extension.
- Include the following Tweaks to the PlayerConfig:
tweaks: {
...
file_protocol : true, // Required if app is being loaded from file system
app_id : "com.bitmovin.yospace.demo" // This should be your WebOS App Id which needs to be allow-listed in Player License and optionally, Analytics License
}
- Make sure the app_id is allow-listed in your Player's License
- In the
YospaceConfigset the paramYospaceConfig.disableServiceWorkertotrue - In the
YospaceConfigset the paramYospaceConfig.useWebostotrue
// Yospace configuration
const yospaceConfig = {
...
disableServiceWorker: true, // Disable Service Worker for Tizen Web App use
useTizen: true,
};- Run
npm run build-tv - Open the
WebOSfolder in Visual Studio Code with the WebOS TV extension, or use the WebOS CLI directly.
-
Recommended:
yo.pdt=trueandyo.lpa=durThe ad server generates a continuous timeline based on the actual segment durations, calculating PDT tags that match the sum of those durations. This ensures full compatibility with the latest Bitmovin Player’s behavior and expectations.
-
Not Recommended:
yo.pdt=syncandyo.lpa=trueThe ad server aligns Program Date Time tags with the scheduled wall-clock timeline of the source, prioritizing schedule alignment over actual ad duration. If an ad break exceeds its planned length (for example, 34s in a 30s slot), the manifest enforces a timeline reset causing recent player versions (
v8.184.0+) to skip content to realign. -
Deprecated:
yo.pdt=false(or omittingyo.pdt)No Program Date Time tags are generated. This mode is deprecated and no longer recommended.
- No support for ad tracking during live streams in Safari if EMSG tags are used. (EMSG tags are not supported by Safari)
- Use node.js version specified in
.nvmrc - Set up your access to the private npm registry of Yospace
- Run
npm ci - Use
npm run startto run a webpack dev server
- This repo uses semantic versioning. Features and bug fixes should be implemented in separate feature branches, branch off the
mainbranch. - PRs should be made against
mainbranch - PRs should always contain an update of the CHANGELOG.md file
- Especially when updating the Yospace SDK, this project should be validated following https://developer.yospace.com/sdk-documentation/javascript/userguide/yosdk/latest/en/validate-your-app.html. This can be done using the sample page with the following steps:
- Run
npm start - Open
localhost:8080?validation=truein a browser - Select a source from the list to start playback and the validation logs. Alternatively, you can add the URL parameter
autoLoadSource=1(to load the first source in the list). - Save console logs and upload them to the Yospace validation tool
- Run
- Releasing a new version is fully automated. It can be triggered using the Release a new version Github Action on the
mainbranch. The workflow will:- bump the version automatically based on the current version in
package.jsonand changes in the[Unreleased]section of theCHANGELOG.md - build the project
- tag the new release in git
- create a new release on GitHub
- publish the update to npm
- bump the version automatically based on the current version in
- The Bitmovin Player shall not be packaged into the JS file created by the build of this integration. To achieve this, types can be imported and used, but no code must be imported/used (including string enums!)