Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Unable to use this.player.fullscreen.enter(); #70

Open
allaboutdeepak opened this issue Dec 17, 2020 · 2 comments
Open

Unable to use this.player.fullscreen.enter(); #70

allaboutdeepak opened this issue Dec 17, 2020 · 2 comments

Comments

@allaboutdeepak
Copy link

allaboutdeepak commented Dec 17, 2020

I need to play video in fullscreen mode on play button click.As per document it should be Entering in full screen mode
on play.Please help closing this issue.

this.player.fullscreen.enter();

import { PlyrComponent } from 'ngx-plyr';
import * as Plyr from 'plyr';

plyr: PlyrComponent;
    player: Plyr;
    options: Plyr.Options = {
      fullscreen: { enabled: true,fallback:'force' },
      autoplay: false,
      settings: ['quality'],
      quality: {default: 576, options: [1080, 720, 576]},
      controls: ['play-large','play', 'progress', 'current-time', 'settings', 'fullscreen'],
      };
  
    videoSources: Plyr.Source[] = [
      {
        src: 'assets/blank.mp4',
        type: 'video/mp4',
        size: 576,
      }
    ];

play()
{
this.player.play();
this.player.fullscreen.enter();
}
html:

<div (plyrEnterFullScreen)="fullScreenEnter($event)"
                (plyrExitFullScreen) ="fullScreenExit($event)" plyr [plyrOptions]="options"  [plyrCrossOrigin]="true" [plyrPlaysInline]="false" [plyrSources]="videoSources" (plyrInit)="player = $event"></div>
@KangHidro
Copy link

let try:
HTML: <div ........ (plyrPlay)="fullScreen()" ........ >

TS:

fullScreen() {
  this.player.fullscreen.enter();
}

@arnab-bhattacharjee-codeclouds

I need to play the video in fullscreen mode when the user is changing the screen orientation to landscape mode. It's not working all the time.

this.so.lock(this.so.ORIENTATIONS.LANDSCAPE_PRIMARY);

[plyrOptions]="{'autoplay': true, 'fullscreen': { 'enabled': true, 'fallback': 'full window/viewport' }, 'hideControls': false, 'ratio': '16:9', 'vimeo': {ratio:'16:9'}}"

This is the code and options I am using.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants