Skip to content
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

Videoplayer rework #182

Merged
merged 34 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0a68afe
✨ re-enable quality selection
moisout Oct 20, 2020
f43001d
✨ initial mediaSession support
moisout Oct 21, 2020
1a8c3c9
shared dto folder, videoplayer composition api
moisout Oct 21, 2020
a586644
🐛 add events to return
moisout Oct 23, 2020
0408ec7
🚧 add loadDashVideo method
moisout Oct 23, 2020
c620e33
Merge branch 'videoplayer-rework' of github.com:ViewTube/viewtube-vue…
moisout Oct 23, 2020
da331f3
🚧 export seekbar events
moisout Oct 23, 2020
3acb9aa
🐛 use video props
moisout Oct 23, 2020
02a58ec
🚧 videoplayer migration progress
moisout Oct 30, 2020
4ea3aa0
🚧 composition api migration progress
moisout Oct 30, 2020
c50bf88
🏗 finished video player composition api migration
moisout Nov 1, 2020
2dd2d2c
🐛 fix fullscreen
moisout Nov 1, 2020
dda9007
🚧 begin fixing qualityselection
moisout Nov 2, 2020
05300ec
✨ working quality selection
moisout Nov 3, 2020
b54bcd5
🚧 work on mobile friendly audio
moisout Nov 3, 2020
4ce990f
✨ enable mediasession playback control
moisout Nov 13, 2020
0dc8049
✨ update mediasession progress when it changes
moisout Nov 13, 2020
190fa47
🐛 some video page fixes
moisout Nov 13, 2020
be89f60
🐛 catch error in setPositionState
moisout Nov 13, 2020
176f207
Merge branch 'videoplayer-rework' of github.com:mauriceoegerli/viewtu…
moisout Nov 13, 2020
3639341
🐛 only update playback progress every second
moisout Nov 13, 2020
a780f40
⚡️ unly update seekbar every second
moisout Nov 13, 2020
01427e8
🐛 remove debugger
moisout Nov 13, 2020
1e1e31c
✨ keyboard gestures for volume control, touch gestures for skip ahead…
moisout Nov 14, 2020
1f4a7d3
🐛 fix player touch events
moisout Nov 15, 2020
f9c7419
🚧 chapters work in progress
moisout Nov 20, 2020
dd0607a
🚧 add titles to chapters
moisout Nov 21, 2020
43fc151
⬆️ upgrade packages
moisout Nov 27, 2020
a6cef63
✨ Added chapter titles to seekbar
moisout Nov 27, 2020
2f0ea27
✨ add links to text
moisout Nov 29, 2020
a7a124d
⬆️ update packages
moisout Nov 30, 2020
1684357
🐛 fix package problems
moisout Nov 30, 2020
229f509
✨ clickable timestamps in description
moisout Nov 30, 2020
8e96112
Merge branch 'main' into videoplayer-rework
moisout Nov 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions client/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ export default Vue.extend({
}
})
.then(response => {
this.replies = response.comments;
this.repliesContinuationLink = response.continuation || null;
this.replies = response.data.comments;
this.repliesContinuationLink = response.data.continuation || null;
this.repliesLoaded = true;
this.loadingReplies = false;
})
Expand All @@ -157,8 +157,8 @@ export default Vue.extend({
}
})
.then(response => {
this.replies = this.replies.concat(response.comments);
this.repliesContinuationLink = response.continuation || null;
this.replies = this.replies.concat(response.data.comments);
this.repliesContinuationLink = response.data.continuation || null;
this.repliesContinuationLoading = false;
})
.catch(error => {
Expand Down
11 changes: 10 additions & 1 deletion client/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
<h1>Settings</h1>
<h2><ThemeIcon />Theme</h2>
<ThemeSelector />
<h2><ChaptersIcon />Chapters</h2>
<SwitchButton
:value="$store.getters['settings/chapters']"
:label="'Show chapters on a video'"
:disabled="false"
@valuechange="val => $store.commit('settings/setChapters', val)"
/>
<h2><MiniplayerIcon />Miniplayer</h2>
<SwitchButton
:value="$store.getters['settings/miniplayer']"
Expand All @@ -21,6 +28,7 @@
import CloseIcon from 'vue-material-design-icons/Close.vue';
import ThemeIcon from 'vue-material-design-icons/Brightness4.vue';
import MiniplayerIcon from 'vue-material-design-icons/WindowRestore.vue';
import ChaptersIcon from 'vue-material-design-icons/BookOpenVariant.vue';
import ThemeSelector from '@/components/themes/ThemeSelector.vue';
import SwitchButton from '@/components/buttons/SwitchButton.vue';
import '@/assets/styles/popup.scss';
Expand All @@ -33,7 +41,8 @@ export default Vue.extend({
ThemeIcon,
MiniplayerIcon,
SwitchButton,
ThemeSelector
ThemeSelector,
ChaptersIcon
},
data() {
return {
Expand Down
124 changes: 77 additions & 47 deletions client/components/videoplayer/QualitySelection.vue
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
<template>
<div class="quality" @mouseup.stop="onQualityMouseup">
<SettingsIcon @click.stop="onQualityInteraction" @touchend.stop="onQualityTouchInteraction" />
<transition name="circle-bottom">
<div v-if="popup" ref="qualityPopup" class="quality-popup">
<div class="quality-submenu adaptive">
<span class="quality-title"> <MagicIcon />Automatic quality </span>
<div
class="qualities-info"
:class="{ selected: selectedQuality === 0 }"
@click.stop="setAutoQuality"
@touchend.stop="onQualityTouchInteraction"
>
<p>Max: {{ maxAdaptiveQuality.qualityLabel }}</p>
<p>Min: {{ minAdaptiveQuality.qualityLabel }}</p>
<portal to="video-player">
<transition name="quality-popup">
<div
v-if="popup"
class="quality-popup-overlay"
@click.stop="popup = false"
@touchend.stop="popup = false"
>
<div ref="qualityPopup" class="quality-popup">
<div v-if="adaptiveFormats" class="quality-submenu adaptive">
<span class="quality-title"> <MagicIcon />Automatic quality </span>
<div
class="qualities-info"
:class="{ selected: selectedQuality === 0 }"
@click.stop="setAutoQuality"
@touchend.stop="onQualityTouchInteraction"
>
<p>Max: {{ maxAdaptiveQuality.qualityLabel }}</p>
<p>Min: {{ minAdaptiveQuality.qualityLabel }}</p>
</div>
</div>
<div class="quality-submenu">
<span class="quality-title"> <HighDefinitionIcon />Video Quality</span>
<div
v-for="(quality, id) in formatQualities"
:key="id"
class="format-quality-entry"
:class="{
selected: selectedQuality === id
}"
@click.stop="setFormatQuality(id)"
@touchend.stop="onQualityTouchInteraction"
>
{{ quality.qualityLabel }}
</div>
</div>
</div>
</div>
<div class="quality-submenu">
<span class="quality-title"> <HighDefinitionIcon />Legacy format </span>
<div
v-for="(quality, id) in formatStreams"
:key="id + 1"
class="format-quality-entry"
:class="{
selected: selectedQuality === id + 1
}"
@click.stop="setFormatQuality(id + 1)"
@touchend.stop="onQualityTouchInteraction"
>
{{ quality.qualityLabel }}
</div>
</div>
</div>
</transition>
</transition>
</portal>
</div>
</template>

Expand All @@ -50,12 +59,12 @@ export default Vue.extend({
MagicIcon
},
props: {
selectedQuality: Number,
formatStreams: Array,
adaptiveFormats: Array
adaptiveFormats: { type: Array, required: false, default: null }
},
data: () => ({
qualityUrl: null,
selectedQuality: 1,
popup: false,
elementHeight: 0
}),
Expand All @@ -66,6 +75,9 @@ export default Vue.extend({
minAdaptiveQuality(): any {
return this.sortedAdaptiveQualities[0];
},
formatQualities(): any {
return this.formatStreams.filter(el => el.qualityLabel);
},
sortedAdaptiveQualities(): any {
return this.adaptiveVideos.slice().sort((a, b) => parseInt(a.bitrate) - parseInt(b.bitrate));
},
Expand All @@ -83,40 +95,58 @@ export default Vue.extend({
},
onQualityMouseup() {},
onQualityTouchInteraction() {},
setFormatQuality() {},
setFormatQuality(nr: number) {
this.$emit('qualityselect', nr);
},
setAutoQuality() {}
}
});
</script>

<style lang="scss">
.circle-bottom-enter-active,
.circle-bottom-leave-active {
transition: clip-path 300ms $intro-easing, transform 300ms $intro-easing;
.quality-popup-enter-active,
.quality-popup-leave-active {
.quality-popup {
transition: transform 300ms $intro-easing;
}
transition: opacity 280ms $intro-easing;
}
.circle-bottom-enter-to,
.circle-bottom-leave {
clip-path: circle(200% at 95% 95%);
transform: translateY(0);
.quality-popup-enter-to,
.quality-popup-leave {
.quality-popup {
transform: scale(1);
}
opacity: 1;
}
.circle-bottom-enter,
.circle-bottom-leave-to {
clip-path: circle(0 at 95% 95%);
transform: translateY(20px);
.quality-popup-enter,
.quality-popup-leave-to {
.quality-popup {
transform: scale(1.1);
}
opacity: 0;
}
$bottom-controls-height: $bottom-overlay-height - $video-seekbar-height;

.quality {
width: 40px;
height: 40px;
margin: 0;
align-self: center;
position: relative;
$bottom-controls-height: $bottom-overlay-height - $video-seekbar-height;
}

.quality-popup-overlay {
position: absolute;
background-color: #00000063;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 141;
display: grid;

.quality-popup {
position: absolute;
top: -240px;
right: 0;
margin: auto;
display: flex;
flex-direction: column;
width: unset;
Expand Down
2 changes: 1 addition & 1 deletion client/components/videoplayer/SeekbarPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default Vue.extend({
height: 90px;
margin: 0 0 0 -11px;
position: absolute;
bottom: 24px;
bottom: 40px;
background-color: $video-thmb-overlay-bgcolor;
opacity: 0;
pointer-events: none;
Expand Down
Loading