Skip to content

Commit

Permalink
Merge pull request #174 from bitmovin/feature/handle-non-yospace-id3t…
Browse files Browse the repository at this point in the history
…ags-gracefully

Handle non-yospace id3tags gracefully
  • Loading branch information
dweinber authored Jul 12, 2024
2 parents 00c3566 + 9f7feca commit da2ca94
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 189 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"singleQuote": true,
"semi": true,
"printWidth": 120
"printWidth": 140
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Changed

- Yospace SDK to v3.6.9

### Fixed

- Parsing non-Yospace ID3 tags and passing those to the Yospace SDK

## [2.5.0] - 2024-07-10

### Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ This integration completely encapsulates the usage of Yospace. After creating th
2. Install the Bitmovin Player Yospace Integration: `npm i -S @bitmovin/player-integration-yospace`
3. Import the `BitmovinYospacePlayer` into your code: `import { BitmovinYospacePlayer } from '@bitmovin/player-integration-yospace';`
4. Import the Bitmovin `Player` core into your code: `import { Player } from 'bitmovin-player/modules/bitmovinplayer-core';`
5. Add the relevant Bitmovin Player modules to the `Player` object using the static `Player.addModule(...)` API
6. Create a new player instance, and pass the BitmovinPlayerStaticAPI to it: `new BitmovinYospacePlayer(Player, container, config)`
5. Add the relevant Bitmovin Player modules to the `Player` object using the static `Player.addModule(...)` API. Please note that `bitmovinplayer-advertising-core` and `bitmovinplayer-advertising-bitmovin` are required by this integration and must be provided.
6. Create a new player instance, and pass the `BitmovinPlayerStaticAPI` to it: `new BitmovinYospacePlayer(Player, container, config)`
7. Load a `YospaceSourceConfig` with your Yospace HLS/DASH URL. It's a `PlayerConfig` with Yospace-specific extension. Most important extension is the `assetType`, 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.

```ts
Expand Down
104 changes: 32 additions & 72 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
"author": "Bitmovin",
"license": "MIT",
"dependencies": {
"@yospace/admanagement-sdk": "3.6.0",
"@yospace/admanagement-sdk": "3.6.9",
"fast-safe-stringify": "^2.0.7",
"process": "^0.11.10",
"stream-browserify": "^3.0.0"
},
"peerDependencies": {
"@yospace/admanagement-sdk": "3.6.0",
"bitmovin-player": "^8.157.0"
},
"devDependencies": {
Expand Down
81 changes: 23 additions & 58 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,47 +27,21 @@
<script type="text/javascript" src="js/bitmovin-player-yospace.js"></script>

<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-core.js"></script>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-polyfill.js"
></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-polyfill.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-style.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-xml.js"></script>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-advertising-core.js"
></script>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-advertising-bitmovin.js"
></script>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-mserenderer.js"
></script>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-engine-bitmovin.js"
></script>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-container-mp4.js"
></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-advertising-core.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-advertising-bitmovin.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-mserenderer.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-engine-bitmovin.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-container-mp4.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-hls.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-dash.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-abr.js"></script>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-container-ts.js"
></script>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-engine-native.js"
></script>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-serviceworker-client.js"
></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-container-ts.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-crypto.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-engine-native.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-serviceworker-client.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-tizen.js"></script>
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-webos.js"></script>

Expand Down Expand Up @@ -141,9 +115,7 @@
<div class="input-group mb-3">
<select class="custom-select col-12" id="tearsheet-override">
<option value="0" selected>Override Ad Tearsheet</option>
<option value="55085793" data-id="141403_CNN_Fuji_VPAID_30s_307518956_6.30">
55085793 - Fuji Film 30s
</option>
<option value="55085793" data-id="141403_CNN_Fuji_VPAID_30s_307518956_6.30">55085793 - Fuji Film 30s</option>
<option value="54510215" data-id="139334_CNN_Invesco_Markets_VPAID_15s_306893272_6.28.21">
54510215 - Invesco Limited 15s
</option>
Expand All @@ -153,21 +125,13 @@
<option value="52125737" data-id="138227_CNN_IBM CA Cash_Desktop_15s_VPAID_289436970_NEW_2.25.21">
52125737 - IBM Corp 15s
</option>
<option value="54476788" data-id="141744_CNN_Farmers_Q3_15s_VPAID_2371065_6.24.21">
54476788 - Farmers 15s
</option>
<option value="54476788" data-id="141744_CNN_Farmers_Q3_30s_VPAID_2371066_6.24.21">
54476788 - Farmers 30s
</option>
<option value="54476788" data-id="141744_CNN_Farmers_Q3_15s_VPAID_2371065_6.24.21">54476788 - Farmers 15s</option>
<option value="54476788" data-id="141744_CNN_Farmers_Q3_30s_VPAID_2371066_6.24.21">54476788 - Farmers 30s</option>
<option value="50323493" data-id="138527_CNN_ROS_Tobacco_Free_Kids_293007205_VPAID_30s_1.7">
50323493 - Tobacco Free Kids 30s
</option>
<option value="49929643" data-id="138222_CNN_IBM CA_VPAID_289542595_15s_NEW_2.25.21">
49929643 - IBM Corp-2 30s
</option>
<option value="55085793" data-id="141403_CNN_Fuji_Vpaid_with_mp4_30_307581174_7.1">
55085793 - Fuji Film-2 30s
</option>
<option value="49929643" data-id="138222_CNN_IBM CA_VPAID_289542595_15s_NEW_2.25.21">49929643 - IBM Corp-2 30s</option>
<option value="55085793" data-id="141403_CNN_Fuji_Vpaid_with_mp4_30_307581174_7.1">55085793 - Fuji Film-2 30s</option>
<option value="51153356" data-id="141403_CNN_Fuji_Vpaid_with_mp4_30_307581174_7.1">
51153356 - Association of AM Railroads 15s
</option>
Expand Down Expand Up @@ -382,8 +346,11 @@
var liveSource = {
title: 'Live Stream',
// dash: "https://csm-e-sdk-validation.bln1.yospace.com/csm/extlive/yosdk01,t2-dash.mpd?yo.av=3", // v0 emsg
dash: 'https://csm-e-sdk-validation.bln1.yospace.com/csm/extlive/yosdk01,dash.mpd?yo.av=3', // v1 emsg
// dash: 'https://csm-e-sdk-validation.bln1.yospace.com/csm/extlive/yosdk01,dash.mpd?yo.av=3', // v1 emsg
// hls: 'https://csm-e-sdk-validation.bln1.yospace.com/csm/extlive/yospace02,hlssample42.m3u8?yo.br=true&yo.av=3',

hls: 'https://csm-e-sdk-validation.bln1.yospace.com/csm/extlive/yospace02,hlssample42.m3u8?yo.br=true&yo.av=4',

// Yospace configuration
assetType: bitmovin.player.ads.yospace.YospaceAssetType.LINEAR,
};
Expand Down Expand Up @@ -416,8 +383,7 @@
var artOfMotionSource = {
dash: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd',
hls: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8',
progressive:
'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/MI201109210084_mpeg-4_hd_high_1080p25_10mbits.mp4',
progressive: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/MI201109210084_mpeg-4_hd_high_1080p25_10mbits.mp4',
poster: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/poster.jpg',
};

Expand All @@ -430,7 +396,7 @@
autoplay: autoplay, // Fix for Pre-roll 'blip' does not work with autoplay enabled
},
logs: {
level: 'none',
level: !isValidationMode ? 'warn' : 'none',
bitmovin: !isValidationMode,
},
ui: false,
Expand Down Expand Up @@ -513,6 +479,7 @@
bitmovin.player.core.Player.addModule(window.bitmovin.player['container-ts'].default);
bitmovin.player.core.Player.addModule(window.bitmovin.player['container-mp4'].default);
bitmovin.player.core.Player.addModule(window.bitmovin.player['engine-native'].default);
bitmovin.player.core.Player.addModule(window.bitmovin.player['crypto'].default);

if (!yospaceConfig.disableServiceWorker) {
bitmovin.player.core.Player.addModule(window.bitmovin.player['serviceworker-client'].default);
Expand Down Expand Up @@ -715,9 +682,7 @@
}

$('#adBreakLabel').text('AdBreak: ' + Number(duration).toFixed(2) + 's remaining');
$('#adLabel').text(
'Ad ' + adCounter + ' of ' + adBreak.ads.length + ': ' + Number(adDuration).toFixed(2) + 's remaining'
);
$('#adLabel').text('Ad ' + adCounter + ' of ' + adBreak.ads.length + ': ' + Number(adDuration).toFixed(2) + 's remaining');
} else {
$('#adBreakLabel').text('AdBreak: false');
$('#adLabel').text('Ad: false');
Expand Down
Loading

0 comments on commit da2ca94

Please sign in to comment.