videogular / videogular2

The HTML5 video player for Angular 2
https://videogular.github.io/videogular2-showroom/#/
MIT License
672 stars 210 forks source link

Fullscreen on macOS Safari not using native API #816

Open shanehsu opened 5 years ago

shanehsu commented 5 years ago

Description

Fullscreen on macOS isn't using native API.

Expected Behavior

The fullscreen button should use the macOS native API.

Actual Behavior

Instead of requesting the media element to fullscreen, the Videogular element is requested instead.

Steps to Reproduce

  1. I used the code below,
<vg-player (onPlayerReady)="onPlayerReady($event)">
    <vg-controls>
        <vg-play-pause></vg-play-pause>
        <vg-playback-button></vg-playback-button>
        <vg-fullscreen></vg-fullscreen>
    </vg-controls>

    <video [vgMedia]="media" #media id="singleVideo" preload="auto" crossorigin>
        <source src="<!-- I used a video of dimension 720x1280 -->" type="video/mp4">
    </video>
</vg-player>
  1. Click on the fullscreen button

Cause

The fullscreen button on iOS correctly triggers the native fullscreen API, not the case on macOS with Safari 12.0.2. The check at vg-fullscreen-api.ts:133 specifically check for whether it's a mobile device and request fullscreen for different element. If we include macOS in the if statement, it should work fine.