TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://thewidlarzgroup.github.io/react-native-video/
MIT License
7.17k stars 2.89k forks source link

duration is wrong #1301

Closed s0s0s0 closed 2 years ago

s0s0s0 commented 5 years ago

Current behavior

10-24 09:24:52.008  6684  6752 D ReactNativeJS: [ 'data',
10-24 09:24:52.008  6684  6752 D ReactNativeJS:   { canStepForward: true,
10-24 09:24:52.008  6684  6752 D ReactNativeJS:     duration: -9223372036854776,
10-24 09:24:52.008  6684  6752 D ReactNativeJS:     canPlaySlowReverse: true,
10-24 09:24:52.008  6684  6752 D ReactNativeJS:     naturalSize: { orientation: 'portrait', height: 0, width: 0 },
10-24 09:24:52.008  6684  6752 D ReactNativeJS:     textTracks: [],
10-24 09:24:52.008  6684  6752 D ReactNativeJS:     canPlayFastForward: true,
10-24 09:24:52.008  6684  6752 D ReactNativeJS:     canPlaySlowForward: true,
10-24 09:24:52.008  6684  6752 D ReactNativeJS:     currentTime: 0,
10-24 09:24:52.008  6684  6752 D ReactNativeJS:     audioTracks: [ { language: '', title: '0', type: 'audio/mp4a-latm', index: 0 } ],
10-24 09:24:52.008  6684  6752 D ReactNativeJS:     canPlayReverse: true,
10-24 09:24:52.008  6684  6752 D ReactNativeJS:     canStepBackward: true } ]

duration is -9223372036854776

Reproduction steps

Download mp4a-latm and see.

Expected behavior

duration should be positive integer

Platform

Which player are you experiencing the problem on:

iOS/Android works fine on (package version 2.x.x). I am trying to upgrade to latest 4.x

Video sample

see comments.

s0s0s0 commented 5 years ago

test.zip you need to unzip and rename this file. (PS: only audio no video)

Happytrio commented 5 years ago

I have the same problem. iOS is fine。but android: duration: -9223372036854776,

cobarx commented 5 years ago

Please test with 4.0.0, we aren't supporting older releases. There was a bug with duration in ExoPlayer 2.x that was fixed in 3.0

s0s0s0 commented 5 years ago

@cobarx there is a confusion. This error is shown in 4.x, but not reproducible in 2.x. I believe there is a bug in the latest version. Please reopen this issue.

uncledent commented 5 years ago

Same problem on all 4* versions. When wile uploaded from ios and trying to download on android - "data":{"canStepBackward":true,"canPlayReverse":true,"canPlaySlowReverse":true,"canPlaySlowForward":true,"textTracks":[],"audioTracks":[{"language":"","type":"audio/mp4a-latm","title":"0","index":0}],"canStepForward":true,"canPlayFastForward":true,"naturalSize":{"orientation":"portrait","height":0,"width":0},"currentTime":0,"duration":-9223372036854776}

GrinchakAndrew commented 5 years ago

I have got same issue on Android for type "audio/mp4a-latm", pls., re-open the issue.

CptFabulouso commented 5 years ago

Happens to me with mp3 files

joepake commented 5 years ago

Same issue on iOS for type (audio/mp4; codecs="mp4a.40.2") seem player duration in onLoad = 2 x real-audio-duration

anshul-kai commented 5 years ago

This is definitely happening on iOS when using a URL for a vbr MP3. Here's a sample file. It's exactly 10 minutes long.

https://bnirvana-tmp.s3-us-west-2.amazonaws.com/duration-test.mp3

ALashchotka commented 4 years ago

Any solutions?

ALashchotka commented 4 years ago

Recoding video from X-264 to H-264 works for me

ccksfh commented 4 years ago

Any solutions?

Javimtib92 commented 4 years ago

I'm having the same problem, is there any workaround?

MinhNguyenWre commented 4 years ago

Any solutions now? still get this bug.

SpQuyt commented 2 years ago

In my case, the video from remote URL worked fine. But when I downloaded it, react-native-video could not get exact duration. It returned -9223372036854776 Since this library has this bug on Android, you can use some tricks by using this repo to get duration instead. https://github.com/mybigday/react-native-media-meta

I tested and worked for my case.

SpQuyt commented 2 years ago

Sorry everyone, my trick can only be used to show duration. I cannot seek the video because the real duration from react-native-video is invalid. So I still need help on this problem

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are having a similar problem, please open a new issue and reference this one instead of commenting on a stale or closed issue.

Younext19 commented 3 months ago

Still happening on 6.3.0

freeboub commented 3 months ago

Still happening on 6.3.0

This issue is too old, please open a new one