Skip to content

Commit

Permalink
Merge pull request #681 from bitmovin/feature/remove-watermark-per-de…
Browse files Browse the repository at this point in the history
…fault

Remove Watermark per default
  • Loading branch information
stonko1994 authored Jan 17, 2025
2 parents 08382a3 + a7c4c8d commit 061b523
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
16 changes: 14 additions & 2 deletions assets/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ <h4 class="card-title">
// {title: 'Recommendation 12: Ain\'t no better video than this', url: 'http://bitmovin.com', thumbnail: 'http://placehold.it/300x300', duration: 34}
// ],
// seekbarSnappingRange: 0,
includeWatermark: true,
};

var player;
Expand Down
2 changes: 1 addition & 1 deletion src/html/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
};

var player = new bitmovin.player.Player(document.getElementById('player'), conf);
var uiManager = bitmovin.playerui.UIFactory.buildDefaultUI(player, {});
var uiManager = bitmovin.playerui.UIFactory.buildUI(player, { includeWatermark: true });
player.load(source);
</script>
</body>
Expand Down
7 changes: 7 additions & 0 deletions src/ts/UIConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,11 @@ export interface UIConfig {
* Specifies if the `EcoModeToggleButton` should be displayed within the `SettingsPanel`
*/
ecoMode?: boolean;
/**
* Specifies if the Watermark element should be included in the UI.
* Per default, the Watermark shows the Bitmovin Logo.
*
* Default: false
*/
includeWatermark?: boolean;
}
16 changes: 12 additions & 4 deletions src/ts/UIFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export namespace UIFactory {
* @param config The UIConfig object
*/
export function buildCastReceiverUI(player: PlayerAPI, config: UIConfig = {}): UIManager {
return new UIManager(player, castReceiverUILayout(), config);
return new UIManager(player, castReceiverUILayout(config), config);
}

/**
Expand Down Expand Up @@ -309,6 +309,10 @@ function uiLayout(config: UIConfig) {
],
});

const conditionalComponents = [
config.includeWatermark ? new Watermark() : null,
].filter((e) => e);

return new UIContainer({
components: [
subtitleOverlay,
Expand All @@ -318,8 +322,8 @@ function uiLayout(config: UIConfig) {
controlBar,
new TitleBar(),
new RecommendationOverlay(),
new Watermark(),
settingsPanel,
...conditionalComponents,
new ErrorMessageOverlay(),
],
hideDelay: 2000,
Expand Down Expand Up @@ -543,7 +547,7 @@ function smallScreenAdsUILayout() {
});
}

function castReceiverUILayout() {
function castReceiverUILayout(config: UIConfig) {
let controlBar = new ControlBar({
components: [
new Container({
Expand All @@ -563,14 +567,18 @@ function castReceiverUILayout() {
],
});

const conditionalComponents = [
config.includeWatermark ? new Watermark() : null,
].filter((e) => e);

return new CastUIContainer({
components: [
new SubtitleOverlay(),
new BufferingOverlay(),
new PlaybackToggleOverlay(),
new Watermark(),
controlBar,
new TitleBar({ keepHiddenWithoutMetadata: true }),
...conditionalComponents,
new ErrorMessageOverlay(),
],
cssClasses: ['ui-cast-receiver'],
Expand Down

0 comments on commit 061b523

Please sign in to comment.