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

[BUG]: Some video cant be load. OnLoad doesn't get called. isBuffering stuck at true. #4007

Closed
ng-ha opened this issue Jul 14, 2024 · 5 comments
Labels
bug stale Closed due to inactivity or lack or resources

Comments

@ng-ha
Copy link

ng-ha commented Jul 14, 2024

Version

6.3.0, 6.4.1

What platforms are you having the problem on?

Android

System Version

Android 14

On what device are you experiencing the issue?

Real device

Architecture

Old architecture

What happened?

Package works as expected in simulator.

But on real device (Pixel 6), after re-setState source, some "file:///" source cannot be load. onLoad, onReadyForDisplay doesn't get called. isBuffering is stuck at true.

First source logs:

LOG source {"uri": "file:///data/user/0/com.my.app/cache/244_d1baa119-05d9-4605-9d23-564fe94aaafb/2023121815451718545158505.mp4"}
LOG onIdle
LOG onLoadStart {}
LOG onBuffer {"isBuffering": true}
LOG onLoadStart {}
LOG onVideoTracks {"videoTracks": [{"bitrate": 0, "codecs": "avc1.4D402A", "height": 1034, "index": 0, "rotation": 0, "selected": false, "trackId": "1", "width": 640}]}
LOG onPlaybackStateChanged {"isPlaying": true}
LOG onReadyForDisplay
LOG onBuffer {"isBuffering": false}
LOG onLoad {"audioTracks": [{"bitrate": 128000, "index": 0, "language": "und", "selected": true, "title": null, "type": "audio/mp4a-latm"}], "canPlayFastForward": true, "canPlayReverse": true, "canPlaySlowForward": true, "canPlaySlowReverse": true, "canStepBackward": true, "canStepForward": true, "currentTime": 0, "duration": 26.024, "naturalSize": {"height": 1034, "orientation": "portrait", "width": 640}, "textTracks": [], "trackId": "1", "videoTracks": [{"bitrate": 0, "codecs": "avc1.4D402A", "height": 1034, "index": 0, "rotation": 0, "selected": false, "trackId": "1", "width": 640}]}

Then, set second source, that second one can't be played. Second source logs:

LOG source {"uri": "file:///data/user/0/com.my.app/cache/244_d1baa119-05d9-4605-9d23-564fe94aaafb/1720928478104.mp4"}
LOG onBuffer {"isBuffering": true}
LOG onVideoTracks {"videoTracks": []}
LOG onLoadStart {}
LOG onVideoTracks {"videoTracks": [{"bitrate": 0, "codecs": "avc1.4D0029", "height": 868, "index": 0, "rotation": 0, "selected": false, "trackId": "1", "width": 640}]}

If i set that second source first ( as initial source), video is played as intended. Or i change the first source to another video, then re-set source to second one, both are played as intended. Very strange behaviour.

Reproduction

repository link

Reproduction

<Video
            ref={videoRef}
            source={source}
            onIdle={() => console.log('onIdle')}
            onLoad={e => console.log('onLoad', e)}
            onLoadStart={e => console.log('onLoadStart', e)}
            onReadyForDisplay={() => console.log('onReadyForDisplay')}
            onError={e => console.log('onError', e)}
            onBuffer={e => console.log('onBuffer', e)}
            onVideoTracks={e => console.log('onVideoTracks', e)}
            onPlaybackStateChanged={e =>
              console.log('onPlaybackStateChanged', e)
            }
            style={{
              width: 1034,
              height:  640,
            }}
          />
@ng-ha ng-ha added the bug label Jul 14, 2024
@ng-ha ng-ha changed the title [BUG]: Some video cant load. OnLoad doesn't get called. isBuffering stuck at true. [BUG]: Some video cant be load. OnLoad doesn't get called. isBuffering stuck at true. Jul 14, 2024
@freeboub
Copy link
Collaborator

Did you have a look to the logcat ? maybe you will have more information inside this log...

@YangJonghun
Copy link
Contributor

This happens when inserting another prop into a loaded player.
It looks like Android media3 issue, and I was expecting it would be fixed in #3784
But it still seems to happen.
Tricky fix is to pass source an integer(not decimal) greater than 0 for startPosition, such as 1 on Android.
(currently there is a bug in media3 where it buffers indefinitely if you treat it as 0 or null)

@JCYDigitalinnov
Copy link

This happens when inserting another prop into a loaded player. It looks like Android media3 issue, and I was expecting it would be fixed in #3784 But it still seems to happen. Tricky fix is to pass source an integer(not decimal) greater than 0 for startPosition, such as 1 on Android. (currently there is a bug in media3 where it buffers indefinitely if you treat it as 0 or null)

Thanks for the temporary fix! This works for me, for now.

Copy link

This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically.

@github-actions github-actions bot added the stale Closed due to inactivity or lack or resources label Aug 31, 2024
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Closed due to inactivity or lack or resources
Projects
None yet
Development

No branches or pull requests

4 participants