-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new advertising UI layout #660
Changes from 7 commits
b569fb9
0e51dbc
7a009c4
f56d889
b232e1a
b76e145
cb7558b
05aa183
8a99ee5
b7a0f42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@import '../variables'; | ||
|
||
%ui-button-ad-skip { | ||
@extend %ui-button; | ||
|
||
background-color: transparentize(#000, 0.75); | ||
border-radius: 20px; | ||
padding: 0em 1em; | ||
min-width: fit-content; | ||
|
||
.#{$prefix}-label { | ||
display: inline-block; | ||
color: $color-ads; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH i find the yellow text hard to read, are we sure we want to stick with that yellow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noted. I'll take that feedback back to the design process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't your eyes hurt when looking at the above screenshot and trying to figure out how may seconds there are left until skip? |
||
|
||
&::after { | ||
background-image: url('../../assets/skin-super-modern/images/ad-skip.svg'); | ||
background-repeat: no-repeat; | ||
background-size: 1em auto; | ||
content: ' '; | ||
display: inline-block; | ||
height: 1em; | ||
vertical-align: bottom; | ||
margin-left: .5em; | ||
width: 1em; | ||
} | ||
} | ||
|
||
&.#{$prefix}-disabled { | ||
.#{$prefix}-label { | ||
&::after { | ||
display: none; | ||
} | ||
} | ||
} | ||
} | ||
|
||
.#{$prefix}-ui-button-ad-skip { | ||
@extend %ui-button-ad-skip; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@import '../variables'; | ||
@import '../mixins'; | ||
|
||
%ad-status-overlay { | ||
@extend %ui-container; | ||
@include layout-align-bottom; | ||
|
||
box-sizing: border-box; | ||
line-height: 1em; | ||
padding: 1em 1em .5em; | ||
|
||
.#{$prefix}-bar { | ||
> .#{$prefix}-container-wrapper { | ||
pointer-events: none; | ||
display: flex; | ||
margin: .5em 0; | ||
} | ||
} | ||
|
||
// Move the overlay up above the controlbar when it appears to avoid them overlapping | ||
&.#{$prefix}-controlbar-visible { | ||
bottom: 5em; | ||
transition: bottom $animation-duration-short ease-in; | ||
} | ||
} | ||
|
||
.#{$prefix}-ui-ad-status-overlay { | ||
@extend %ad-status-overlay; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Container, ContainerConfig } from './container'; | ||
import { AdSkipButton } from './adskipbutton'; | ||
import { Spacer } from './spacer'; | ||
import { PlayerAPI } from 'bitmovin-player'; | ||
import { UIInstanceManager } from '../uimanager'; | ||
import { Component, ComponentConfig } from './component'; | ||
import { ControlBar } from './controlbar'; | ||
|
||
export class AdStatusOverlay extends Container<ContainerConfig> { | ||
private static readonly CLASS_CONTROLBAR_VISIBLE = 'controlbar-visible'; | ||
|
||
constructor(config: ContainerConfig = {}) { | ||
super(config); | ||
|
||
this.config = this.mergeConfig( | ||
config, | ||
{ | ||
components: [ | ||
new Container({ | ||
components: [ | ||
new Spacer(), | ||
new AdSkipButton(), | ||
], | ||
cssClasses: ['bar'], | ||
}), | ||
], | ||
cssClass: 'ui-ad-status-overlay', | ||
}, | ||
this.config, | ||
); | ||
} | ||
|
||
configure(player: PlayerAPI, uimanager: UIInstanceManager) { | ||
super.configure(player, uimanager); | ||
|
||
uimanager.onComponentShow.subscribe((component: Component<ComponentConfig>) => { | ||
if (component instanceof ControlBar) { | ||
this.getDomElement().addClass(this.prefixCss(AdStatusOverlay.CLASS_CONTROLBAR_VISIBLE)); | ||
} | ||
}); | ||
uimanager.onComponentHide.subscribe((component: Component<ComponentConfig>) => { | ||
if (component instanceof ControlBar) { | ||
this.getDomElement().removeClass(this.prefixCss(AdStatusOverlay.CLASS_CONTROLBAR_VISIBLE)); | ||
} | ||
}); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -569,6 +569,13 @@ export class SeekBar extends Component<SeekBarConfig> { | |
return; | ||
} | ||
|
||
// Reset the currentTimeSeekBar and set the position to 0 if the player has no duration | ||
if (this.player.getDuration() === 0) { | ||
this.setPlaybackPosition(0); | ||
currentTimeSeekBar = 0; | ||
return; | ||
} | ||
Comment on lines
+572
to
+577
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was no problem before as there was no seekbar visible during ad playback. |
||
|
||
currentTimeSeekBar += currentTimeUpdateDeltaSecs; | ||
|
||
try { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The styling for the ad-skip-button was extracted into a separate file.