Android Question Exoplayer Negative Value for Duration (Solved, I think)

Ronomega73

Member
Licensed User
Longtime User
I came across a problem of negative values for Exoplayer's duration property. I read somewhere on the net that it is due to the property being yet UNSET (something like that) during the time the value is read. I tried to add a Wait For Exoplayer_Ready (mine was Wait For Exoplayer4_Ready) before reading the duration. It seemed to have solved the problem. Maybe it happens when Exoplayer is not yet done loading the file so the duration is not yet determined. Not an expert so I'm open for correction on this.
 

Sifu

Active Member
Seems you are correct. If you don't use a Sleep(500) or so you get the same negative number each time. With the sleep it gives the correct number of milliseconds.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…