Skip to content

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

Open
@bissaye

Description

@bissaye

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').

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions