Skip to content

Commit

Permalink
v1.17.0 Upgrade player UI
Browse files Browse the repository at this point in the history
Upgrade player to match current color scheme
Improve UX by retaining event listeners for scroll
Fix mouseout handling
Slightly increase player UI size
Add additional padding to edges of control bar
Improve control bar positioning
Fix live stream triggering offline bumps after just leaving an offline stream
Remove featureflag for stream stats
define player accent color with SASS var
  • Loading branch information
DispatchCommit committed May 16, 2020
1 parent 4b8274a commit 947b064
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 25 deletions.
48 changes: 32 additions & 16 deletions assets/style/stream-player.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
$accent-color: #13a9fe;

.video-js {
font-size: 11px;
font-size: 12px;
overflow: hidden;

// Control Bar (container)
.vjs-control-bar {
background-color: rgba(20, 20, 20, 0.45);
background: none;

&::before {
position: absolute;
bottom: 0;
content: '';
height: 5rem;
width: 100%;
background: rgba(20, 20, 20, 0.45);
background: linear-gradient(0deg, rgba(0,0,0,.85) 10%, rgba(0,0,0,0) 100%);
}
}

// Progress Bar
.vjs-progress-control.vjs-control {
position: absolute;
display: block;
display: flex;
align-items: center;
width: 100%;
height: 50%;
transform: translateY(-75%);
height: 1rem;
bottom: 90%;

// Circle play head
.vjs-play-progress::before {
Expand All @@ -29,15 +42,14 @@

// Progress Slider
.vjs-slider {
margin: 0 5px;
top: 50%;
margin: 0 1rem;
}
}

// Load progress color
.vjs-load-progress,
.vjs-load-progress div {
background-color: rgba(60, 60, 60, 0.5);
background-color: rgba(160, 160, 160, 0.5);
}

// Progress Bar Background
Expand All @@ -47,13 +59,13 @@

// Primary Color Progress
.vjs-slider-bar {
background-color: #ffeb3b;
background-color: $accent-color;
}

// Inner Progress Bar
.vjs-play-progress {
background-color: #ffeb3b;
color: #ffeb3b;
background-color: $accent-color;
color: $accent-color;
}

// Spacer
Expand Down Expand Up @@ -89,7 +101,7 @@

// Tooltip
.vjs-mouse-display .vjs-time-tooltip {
color: #ffeb3b;
color: $accent-color;
}

// Tooltip
Expand All @@ -107,18 +119,22 @@
// Transitions control bar between active / inactive
.vjs-has-started {
.vjs-control-bar {
//transform: translateY(0);
opacity: 1;
transition: .3s;
transition: .1s;
}

&.vjs-user-inactive.vjs-playing {
.vjs-control-bar {
//transform: translateY(127%);
opacity: 0;
transition: .3s;
}
}

&.vjs-user-active.vjs-playing {
.vjs-control-bar {

}
}
}


Expand All @@ -136,7 +152,7 @@


a {
color: yellow;
color: $accent-color;
text-decoration: none;
}

Expand Down
7 changes: 4 additions & 3 deletions components/BitPlayer/BitwaveVideoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@
};
// Player is active (mouseover)
this.player.on( 'useractive', () => {
/*this.player.on( 'useractive', () => {
volumeControlElement.addEventListener( 'wheel', handleVolumeScroll );
});
// Player is inactive
this.player.on( 'userinactive', () => {
volumeControlElement.removeEventListener( 'wheel', handleVolumeScroll );
});
});*/
// Add event listener by default in case user loads with cursor over stream
volumeControlElement.addEventListener( 'wheel', handleVolumeScroll, true );
Expand All @@ -270,7 +270,7 @@
controlBar.customControlSpacer.on( 'mouseenter', removeVolumePanelHover );
// remove UI instantly when mouse leaves player
this.player.on( 'mouseleave', () => this.player.userActive(false) );
this.player.on( 'mouseleave', () => this.$nextTick( () => this.player.userActive( false ) ) );
//--------------------------------------------------------------------
Expand All @@ -289,6 +289,7 @@
this.setPiP( true );
this.setDetach( false );
});
this.player.on( 'leavepictureinpicture', () => {
this.setPiP( false );
});
Expand Down
2 changes: 1 addition & 1 deletion components/Channel/StreamInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@

<!-- Debug Stream -->
<v-tab-item
v-if="featureFlag && !replay"
v-if="!replay"
>
<div
style="min-height: 500px"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitwave.tv",
"version": "1.16.1",
"version": "1.17.0",
"description": "An open platform live streaming service for creators to freely express themselves.",
"author": "Dispatch",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions pages/_watch/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@
beforeDestroy () {
window.removeEventListener( 'orientationchange', this.onOrientationChange );
if ( this.streamDataListener ) this.streamDataListener();
if ( this.offlineResetInterval ) clearInterval( this.offlineResetInterval );
},
}
</script>
Expand Down
5 changes: 1 addition & 4 deletions store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,6 @@ export const actions = {
dispatch( $actions.updateViewers ),
];

// Hydrate emotes for logged in users
// if ( authUser && user ) runParallel.push( dispatch( `${Chat.namespace}/${Chat.$actions.updateEmoteList}` ) );

// Run all our API actions in parallel
await Promise.all( runParallel );
},
Expand Down Expand Up @@ -380,7 +377,7 @@ export const actions = {
commit( $mutations.setAuth, auth );
this.$cookies.set( 'auth', auth );

user = JSON.parse( JSON.stringify( user ) );
user = JSON.parse( JSON.stringify( user ) );

if ( unsubscribeUser ) {
console.warn( 'Already had firebase listener!' );
Expand Down

0 comments on commit 947b064

Please sign in to comment.