Fix player menu on mobile
This commit is contained in:
parent
1e904cde34
commit
35f0a5e665
3 changed files with 11 additions and 5 deletions
|
@ -39,8 +39,6 @@ export class RemoteSubscribeComponent extends FormReactive implements OnInit {
|
||||||
fetch(`https://${hostname}/.well-known/webfinger?resource=acct:${username}@${hostname}`)
|
fetch(`https://${hostname}/.well-known/webfinger?resource=acct:${username}@${hostname}`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => new Promise((resolve, reject) => {
|
.then(data => new Promise((resolve, reject) => {
|
||||||
console.log(data)
|
|
||||||
|
|
||||||
if (data && Array.isArray(data.links)) {
|
if (data && Array.isArray(data.links)) {
|
||||||
const link: { template: string } = data.links.find((link: any) => {
|
const link: { template: string } = data.links.find((link: any) => {
|
||||||
return link && typeof link.template === 'string' && link.rel === 'http://ostatus.org/schema/1.0/subscribe'
|
return link && typeof link.template === 'string' && link.rel === 'http://ostatus.org/schema/1.0/subscribe'
|
||||||
|
|
|
@ -233,12 +233,20 @@ class PeerTubePlugin extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
private alterInactivity () {
|
private alterInactivity () {
|
||||||
if (this.menuOpened || this.mouseInControlBar) {
|
if (this.menuOpened) {
|
||||||
this.player.options_.inactivityTimeout = this.savedInactivityTimeout
|
this.player.options_.inactivityTimeout = this.savedInactivityTimeout
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.player.options_.inactivityTimeout = 1
|
if (!this.mouseInControlBar && !this.isTouchEnabled()) {
|
||||||
|
this.player.options_.inactivityTimeout = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private isTouchEnabled () {
|
||||||
|
return ('ontouchstart' in window) ||
|
||||||
|
navigator.maxTouchPoints > 0 ||
|
||||||
|
navigator.msMaxTouchPoints > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
private initCaptions () {
|
private initCaptions () {
|
||||||
|
|
|
@ -201,7 +201,7 @@ export class PeerTubeEmbed {
|
||||||
subtitle: this.subtitle,
|
subtitle: this.subtitle,
|
||||||
|
|
||||||
videoCaptions,
|
videoCaptions,
|
||||||
inactivityTimeout: 1500,
|
inactivityTimeout: 2500,
|
||||||
videoViewUrl: this.getVideoUrl(videoId) + '/views',
|
videoViewUrl: this.getVideoUrl(videoId) + '/views',
|
||||||
|
|
||||||
playerElement: this.videoElement,
|
playerElement: this.videoElement,
|
||||||
|
|
Loading…
Reference in a new issue