videogular / ngx-videogular

The HTML5 video player for Angular 2 and successor to videogular2
MIT License
131 stars 36 forks source link

Fullscreen API does not return a Promise as per the specification #146

Closed jansgescheit closed 1 month ago

jansgescheit commented 1 month ago

Description

According to the Fullscreen API specification, both requestFullscreen() and exitFullscreen() methods should return a Promise. However, in the Videogular library, this behavior is not implemented in the VgFullscreenApiService. The methods are called without returning any Promise.

Expected Behavior

The toggleFullscreen(), request() and exit() methods should return a Promise that resolves when the operation completes.

Actual Behavior

The toggleFullscreen(), request() and exit() methods do not return a Promise. This can cause issues with handling fullscreen transitions properly, especially when chaining operations or handling errors.

Attachments

Code Snippet from VgFullscreenApiService:

enterElementInFullScreen(elem: any) {
  elem[this.polyfill.request]();
}

exit() {
  this.isFullscreen = false;
  this.onChangeFullscreen.emit(false);

  // Exit from native fullscreen
  if (this.isAvailable && this.nativeFullscreen) {
    document[this.polyfill.exit]();
  }
}
IxquitilisSaid commented 1 month ago

Good catch, I'll get it merged and deployed. Thanks for contributing! 😄