Skip to content

Commit

Permalink
add advertising UI variants for the new UI layout
Browse files Browse the repository at this point in the history
  • Loading branch information
stonko1994 committed Dec 18, 2024
1 parent b76e145 commit cb7558b
Showing 1 changed file with 85 additions and 2 deletions.
87 changes: 85 additions & 2 deletions src/ts/uifactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import { ModernSettingsPanelItem } from './components/modernsettingspanelitem';
import { ModernSettingsPanelPage } from './components/modernsettingspanelpage';
import { ModernSettingsPanel } from './components/modernsettingspanel';
import { TouchControlOverlay } from './components/touchcontroloverlay';
import { AdStatusOverlay } from './components/adstatusoverlay';

export namespace UIFactory {
export function buildDefaultSuperModernUI(player: PlayerAPI, config: UIConfig = {}): UIManager {
Expand Down Expand Up @@ -447,11 +448,93 @@ export namespace UIFactory {
}

export function superModernMobileAdsUI() {
return new UIContainer({});
let controlBar = new ControlBar({
components: [
new Container({
components: [
new PlaybackTimeLabel({ timeLabelMode: PlaybackTimeLabelMode.CurrentTime }),
new SeekBar({ label: new SeekBarLabel() }),
new PlaybackTimeLabel({
timeLabelMode: PlaybackTimeLabelMode.TotalTime,
cssClasses: ['text-right'],
}),
],
cssClasses: ['controlbar-top'],
}),
new Container({
components: [
new PlaybackToggleButton(),
new VolumeToggleButton(),
new Spacer(),
new FullscreenToggleButton(),
],
cssClasses: ['controlbar-bottom'],
}),
],
});

return new UIContainer({
components: [
new BufferingOverlay(),
new AdClickOverlay(),
new PlaybackToggleOverlay(),
controlBar,
new AdStatusOverlay(),
new ErrorMessageOverlay(),
],
hideDelay: 2000,
hidePlayerStateExceptions: [
PlayerUtils.PlayerState.Prepared,
PlayerUtils.PlayerState.Paused,
PlayerUtils.PlayerState.Finished,
],
cssClasses: ['ui-skin-super-modern', 'ui-skin-smallscreen', 'ui-skin-ads'],
});
}

export function superModernAdsUI() {
return new UIContainer({});
let controlBar = new ControlBar({
components: [
new Container({
components: [
new PlaybackTimeLabel({ timeLabelMode: PlaybackTimeLabelMode.CurrentTime }),
new SeekBar({ label: new SeekBarLabel() }),
new PlaybackTimeLabel({
timeLabelMode: PlaybackTimeLabelMode.TotalTime,
cssClasses: ['text-right'],
}),
],
cssClasses: ['controlbar-top'],
}),
new Container({
components: [
new PlaybackToggleButton(),
new VolumeToggleButton(),
new Spacer(),
new FullscreenToggleButton(),
],
cssClasses: ['controlbar-bottom'],
}),
],
});

return new UIContainer({
components: [
new BufferingOverlay(),
new AdClickOverlay(),
new PlaybackToggleOverlay(),
new AdStatusOverlay(),
controlBar,
new ErrorMessageOverlay(),
],
hideDelay: 2000,
hidePlayerStateExceptions: [
PlayerUtils.PlayerState.Prepared,
PlayerUtils.PlayerState.Paused,
PlayerUtils.PlayerState.Finished,
],
cssClasses: ['ui-skin-super-modern', 'ui-skin-ads'],
});
}

export function superModernMobileUI() {
Expand Down

0 comments on commit cb7558b

Please sign in to comment.