Archived
2
0

add types.

This commit is contained in:
Miroslav Šedivý 2021-12-04 21:56:16 +01:00
parent da200698dd
commit 8217321ecb
2 changed files with 13 additions and 13 deletions

View File

@ -110,7 +110,7 @@
}, },
}) })
export default class extends Vue { export default class extends Vue {
@Ref('context') readonly context!: any @Ref('context') readonly context!: VueContext
get width() { get width() {
return this.$accessor.video.width return this.$accessor.video.width

View File

@ -31,7 +31,7 @@
</div> </div>
<ul v-if="!fullscreen && !hideControls" class="video-menu top"> <ul v-if="!fullscreen && !hideControls" class="video-menu top">
<li><i @click.stop.prevent="requestFullscreen" class="fas fa-expand"></i></li> <li><i @click.stop.prevent="requestFullscreen" class="fas fa-expand"></i></li>
<li v-if="admin"><i @click.stop.prevent="onResolution" class="fas fa-desktop"></i></li> <li v-if="admin"><i @click.stop.prevent="openResolution" class="fas fa-desktop"></i></li>
<li class="request-control"> <li class="request-control">
<i <i
:class="[hosted && !hosting ? 'disabled' : '', !hosted && !hosting ? 'faded' : '', 'fas', 'fa-keyboard']" :class="[hosted && !hosting ? 'disabled' : '', !hosted && !hosting ? 'faded' : '', 'fas', 'fa-keyboard']"
@ -41,7 +41,7 @@
</ul> </ul>
<ul v-if="!fullscreen && !hideControls" class="video-menu bottom"> <ul v-if="!fullscreen && !hideControls" class="video-menu bottom">
<li v-if="hosting && (!clipboard_read_available || !clipboard_write_available)"> <li v-if="hosting && (!clipboard_read_available || !clipboard_write_available)">
<i @click.stop.prevent="onClipboard" class="fas fa-clipboard"></i> <i @click.stop.prevent="openClipboard" class="fas fa-clipboard"></i>
</li> </li>
<li> <li>
<i <i
@ -212,8 +212,8 @@
@Ref('aspect') readonly _aspect!: HTMLElement @Ref('aspect') readonly _aspect!: HTMLElement
@Ref('player') readonly _player!: HTMLElement @Ref('player') readonly _player!: HTMLElement
@Ref('video') readonly _video!: HTMLVideoElement @Ref('video') readonly _video!: HTMLVideoElement
@Ref('resolution') readonly _resolution!: any @Ref('resolution') readonly _resolution!: Resolution
@Ref('clipboard') readonly _clipboard!: any @Ref('clipboard') readonly _clipboard!: Clipboard
@Prop(Boolean) readonly hideControls!: boolean @Prop(Boolean) readonly hideControls!: boolean
@ -576,6 +576,14 @@
this.onResize() this.onResize()
} }
openResolution(event: MouseEvent) {
this._resolution.open(event)
}
openClipboard() {
this._clipboard.open()
}
async onFocus() { async onFocus() {
if (!document.hasFocus() || !this.$accessor.active) { if (!document.hasFocus() || !this.$accessor.active) {
return return
@ -715,13 +723,5 @@
this._container.style.maxWidth = `${(this.horizontal / this.vertical) * height}px` this._container.style.maxWidth = `${(this.horizontal / this.vertical) * height}px`
this._aspect.style.paddingBottom = `${(this.vertical / this.horizontal) * 100}%` this._aspect.style.paddingBottom = `${(this.vertical / this.horizontal) * 100}%`
} }
onResolution(event: MouseEvent) {
this._resolution.open(event)
}
onClipboard(event: MouseEvent) {
this._clipboard.open(event)
}
} }
</script> </script>