]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Merge branch 'release/2.1.0' into develop
authorChocobozzz <me@florianbigard.com>
Wed, 26 Feb 2020 14:26:02 +0000 (15:26 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 26 Feb 2020 14:26:02 +0000 (15:26 +0100)
1  2 
client/src/app/menu/menu.component.scss
client/src/standalone/videos/embed.ts

index dec04592869a0931015660048601c9c5bc803951,b0517375175d8bf5e299fe54bfcffb8861dc128d..40c9a2b251a4e2330f81553bc67eee590319a5de
@@@ -6,8 -6,7 +6,8 @@@
    height: calc(100vh - #{$header-height});
    padding: 0;
    width: $menu-width;
 -  z-index: 10000;
 +  z-index: z(menu);
 +  scrollbar-color: var(--actionButtonColor) var(--menuBackgroundColor);
  }
  
  menu {
  @media screen and (max-width: $mobile-view) {
    .menu-wrapper {
      width: 100% !important;
-   }
-   .top-menu, .footer {
-     width: 100% !important;
-   }
- }
  
- @media (hover: none) and (pointer: coarse) {
-   .menu-wrapper {
      menu {
        overflow-y: auto;
      }
    }
+   .top-menu, .footer {
+     width: 100% !important;
+   }
  }
index d5b42a0259d065ac06423ddd527e5adb578f18b8,5213443fc54503a1baca3d775e18f72d3bd8ff59..e3bcbc010e20f6222d4e57690422a8c12966a719
@@@ -1,11 -1,15 +1,11 @@@
  import './embed.scss'
  
  import {
 -  getCompleteLocale,
 -  is18nLocale,
 -  isDefaultLocale,
    peertubeTranslate,
    ResultList,
    ServerConfig,
    VideoDetails
  } from '../../../../shared'
 -import { VideoJSCaption } from '../../assets/player/peertube-videojs-typings'
  import { VideoCaption } from '../../../../shared/models/videos/caption/video-caption.model'
  import {
    P2PMediaLoaderOptions,
  import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type'
  import { PeerTubeEmbedApi } from './embed-api'
  import { TranslationsManager } from '../../assets/player/translations-manager'
 +import { VideoJsPlayer } from 'video.js'
 +import { VideoJSCaption } from '../../assets/player/peertube-videojs-typings'
 +
 +type Translations = { [ id: string ]: string }
  
  export class PeerTubeEmbed {
    videoElement: HTMLVideoElement
 -  player: any
 +  player: VideoJsPlayer
    api: PeerTubeEmbedApi = null
    autoplay: boolean
    controls: boolean
@@@ -71,7 -71,7 +71,7 @@@
      element.parentElement.removeChild(element)
    }
  
 -  displayError (text: string, translations?: { [ id: string ]: string }) {
 +  displayError (text: string, translations?: Translations) {
      // Remove video element
      if (this.videoElement) this.removeElement(this.videoElement)
  
      errorText.innerHTML = translatedText
    }
  
 -  videoNotFound (translations?: { [ id: string ]: string }) {
 +  videoNotFound (translations?: Translations) {
      const text = 'This video does not exist.'
      this.displayError(text, translations)
    }
  
 -  videoFetchError (translations?: { [ id: string ]: string }) {
 +  videoFetchError (translations?: Translations) {
      const text = 'We cannot fetch the video. Please try again later.'
      this.displayError(text, translations)
    }
        })
      }
  
 -    this.player = await PeertubePlayerManager.initialize(this.mode, options, (player: any) => this.player = player)
 +    this.player = await PeertubePlayerManager.initialize(this.mode, options, (player: VideoJsPlayer) => this.player = player)
      this.player.on('customError', (event: any, data: any) => this.handleError(data.err, serverTranslations))
  
      window[ 'videojsPlayer' ] = this.player
    }
  
    private async buildDock (videoInfo: VideoDetails, configResponse: Response) {
 -    if (this.controls) {
 -      // On webtorrent fallback, player may have been disposed
 -      if (!this.player.player_) return
 +    if (!this.controls) return
  
 -      const title = this.title ? videoInfo.name : undefined
++    // On webtorrent fallback, player may have been disposed
++    if (!this.player.player_) return
 -      const config: ServerConfig = await configResponse.json()
 -      const description = config.tracker.enabled && this.warningTitle
 -        ? '<span class="text">' + this.player.localize('Watching this video may reveal your IP address to others.') + '</span>'
 -        : undefined
 +    const title = this.title ? videoInfo.name : undefined
  
 -      this.player.dock({
 -        title,
 -        description
 -      })
 -    }
 +    const config: ServerConfig = await configResponse.json()
 +    const description = config.tracker.enabled && this.warningTitle
 +      ? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>'
 +      : undefined
 +
 +    this.player.dock({
 +      title,
 +      description
 +    })
    }
  
    private buildCSS () {