Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Fullscreen Change Event Handling on iOS Leading to TypeError: Cannot Read Properties of Undefined #145

Open
bissaye opened this issue Jul 5, 2024 · 2 comments

Comments

@bissaye
Copy link

bissaye commented Jul 5, 2024

Description

There is an issue with the VgFullscreenApiService in the videogular-ngx-videogular-core.mjs file, specifically related to the handling of the fullscreen change event on iOS. When the polyfill for webkitendfullscreen is used, the code attempts to access this.medias.toArray()[0].elem, which can be undefined and leads to a TypeError: Cannot read properties of undefined. This issue causes the application to crash on iOS devices when attempting to enter or exit fullscreen mode.

Expected Behavior

The fullscreen change event should be handled correctly on iOS devices without causing any errors. The application should be able to enter and exit fullscreen mode smoothly.

Actual Behavior

On iOS devices, the application crashes with the error TypeError: Cannot read properties of undefined (reading 'elem') when attempting to handle the fullscreen change event.

Steps to Reproduce

  1. Set up a project with Videogular and ensure it is running on iOS (Safari or a web view).
  2. Implement a fullscreen functionality using Videogular.
  3. Attempt to enter or exit fullscreen mode on an iOS device.
  4. Observe the error in the console: TypeError: Cannot read properties of undefined (reading 'elem').
@bissaye
Copy link
Author

bissaye commented Jul 5, 2024

i think that we just have to replace fsElemDispatcher =this.medias.toArray()[0].elem ; by fsElemDispatcher = this.medias.length > 0 ? this.medias.toArray()[0].elem : elem;

how can i contribute

@ShivendraKadam
Copy link

did you find any proper solution for this ?

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

No branches or pull requests

2 participants