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

textTracks crash on iOS with m3u8 video #3200

Closed
clementnv opened this issue Aug 9, 2023 · 11 comments
Closed

textTracks crash on iOS with m3u8 video #3200

clementnv opened this issue Aug 9, 2023 · 11 comments

Comments

@clementnv
Copy link

Bug

When textTracks is enable on video .m3u8, crash on iOS device,

Platform

Which player are you experiencing the problem on:

  • iOS

Environment info

Library version: 6.0.0-alpha.6
Device: iPhone 14

Steps To Reproduce

Reproducible sample code

    <Video
          source={{
            uri: 'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8',
          }}
          textTracks={[
            {
              title: 'English CC',
              language: 'en',
              type: TextTrackType.VTT,
              uri: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt',
            },
          ]}
          selectedTextTrack={{
            type: 'language',
            value: 'en',
          }}
        />

You got an error:

react_native_video/RCTVideoUtils.swift:190: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
2023-08-09 23:00:52.007849+0200 KephyreTraining[3788:328590] react_native_video/RCTVideoUtils.swift:190: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
Capture d’écran 2023-08-09 à 23 02 17

...

Expected behaviour

  1. No crash of app

Thank you for your help 🙏

@nicolaosm
Copy link

Experiencing that too! Appreciate any help on this.

@mikmedina
Copy link

same issue

@nicolaosm
Copy link

textTracks also applied on .mp4 videos will lead to an iOS crash on alpha 7. Not just .m3u8

@GhayoorUlHaq
Copy link

GhayoorUlHaq commented Sep 1, 2023

I'm also experiencing the same issue, and here are my findings:

  • Latest alpha release (v6.0.0-alpha.7) will crash when we define textTracks for both .m3u8 and .mp4.
  • Last stable release (5.2.1) is not crashing but when we define textTracks with selectedTrack, .mp4 is working fine even though I can see the subtitles, but.m3u8 is not loading.

@zaferatli
Copy link

Because RCTVideo 314. line send asset url only, then RCTVideoUtils 190 line cannot get assets.timeRange.duration item and return error. We need to send video object from RCTVideo 314 line then crash gonna fix

RCTVideo 314 Line

@freeboub
Copy link
Collaborator

@zaferatli but how to fix the issue and make sideloaded subtitles working? :) I started investigations, but I didn't find trivial fix ...

@zaferatli
Copy link

actually there is func calculatePlayableDuration in RCTVideoUtils when i use this func its return 0, if we get duration of video then we can pass.

@timvvoodman
Copy link

Having the same issue, m3u8 on iOS trying to load text tracks crashes the video player. Due to Accessibility concerns we are having to use a different solution for iOS, would ideally like to use this package for both.

@zaferatli
Copy link

@timvvoodman @freeboub
Image i am pretty close to pr. Probably tomorrow pr will be open

@matteodanelli
Copy link

@timvvoodman @freeboub Image i am pretty close to pr. Probably tomorrow pr will be open

Any news?

@TheWidlarzGroup TheWidlarzGroup deleted a comment from wolfxpertlab Oct 26, 2023
@KrzysztofMoch KrzysztofMoch self-assigned this Nov 1, 2023
@freeboub
Copy link
Collaborator

The crash has been fixed for next release (alpha.11 or beta.1)
unfiortunnetlly this feature doesn't work as expected (like on 5.2 branch, confirmed by @KrzysztofMoch).
linked PR: #3330

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

No branches or pull requests

9 participants