private renderer
private fakeRenderer
private autoResolution = true
+ private forbidAutoResolution = false
private isAutoResolutionObservation = false
private videoViewInterval
this.trigger('autoResolutionUpdate')
}
- disableAutoResolution () {
+ disableAutoResolution (forbid = false) {
+ if (forbid === true) this.forbidAutoResolution = true
+
this.autoResolution = false
this.trigger('autoResolutionUpdate')
}
+ isAutoResolutionForbidden () {
+ return this.forbidAutoResolution === true
+ }
+
getCurrentVideoFile () {
return this.currentVideoFile
}
}
private fallbackToHttp (done?: Function, play = true) {
+ this.disableAutoResolution(true)
+
this.flushVideoFile(this.currentVideoFile, true)
this.torrent = null
this.player.controlBar.on('mouseenter', () => disableInactivity())
settingsDialog.on('mouseenter', () => disableInactivity())
this.player.controlBar.on('mouseleave', () => enableInactivity())
- settingsDialog.on('mouseleave', () => enableInactivity())
+ // settingsDialog.on('mouseleave', () => enableInactivity())
}
private pickAverageVideoFile () {
}
handleClick (event) {
+ if (this.id === -1 && this.player_.peertube().isAutoResolutionForbidden()) return
+
super.handleClick(event)
// Auto resolution
}
updateSelection () {
+ // Check if auto resolution is forbidden or not
+ if (this.id === -1) {
+ if (this.player_.peertube().isAutoResolutionForbidden()) {
+ this.addClass('disabled')
+ } else {
+ this.removeClass('disabled')
+ }
+ }
+
if (this.player_.peertube().isAutoResolutionOn()) {
this.selected(this.id === -1)
return
transition: all $setting-transition-duration $setting-transition-easing;
.vjs-menu-item {
+ font-size: 1em;
+ text-transform: initial;
&:hover {
+ cursor: pointer;
background-color: rgba(255, 255, 255, 0.2);
}
&:last-child {
margin-bottom: 5px;
}
- }
- li {
- font-size: 1em;
- text-transform: initial;
-
- &:hover {
- cursor: pointer;
+ &.disabled {
+ opacity: 0.5;
+ cursor: default !important;
+ background-color: inherit !important;
}
}
}