-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Rethink handling of "unseekable" mp3 files #2445
Comments
Have you seen #1299? |
@AquilesCanta I have now (I did try and search for similar issues but didn't find any), my vote @ojw28 would be to assume constant bit rate and allow seeking, or at the very least have this as a configuration parameter. We're working on a new version of our app at the moment and not being able to seek (or even resume from the middle of) files like this would be a deal breaker :( |
Are you in control of the media being played? If not then where is it typically coming from? We're unlikely to add support for this case. As per #1299 it's unlikely MediaPlayer is doing a particularly good job of allowing seeking (there's likely a significant trade-off of one kind or another involved). |
@ojw28 we make a podcasting app, so we have 0 control over the media. Also this file seeks just fine on both iOS (using AVPlayer or AVAudioEngine) as well as on Android using MediaPlayer or just an Extractor. I understand the reasoning, but I have yet to see any of the previous solutions get seeking wrong in a CBR file. Pretty much all podcasts are CBR, VBR is extremely rare (< 1%). I get this could be specific to our case, but still, it would mean we'd have to fork this project and maintain a fork just to get this behaviour. Won't somebody please think of the children ;) |
@ojw28 curious to know if this is something you'd consider, or whether your intention is to keep it as is. If we were to make this change ourselves I'd be curious on your opinion as to the best place to make it, and whether you'd consider a pull request for it or not? |
I think it's quite problematic to turn it on blindly, particularly with respect to playlist support. We could probably have it as an option that you can enable on the extractor. You'd need to pass your own ExtractorsFactory to ExtractorMediaSource that sets the option, if we were to go down that route. |
@ojw28 completely agree that it shouldn't be on by default. I guess my question was around where to add the API. For example the player could have a seekToApproximatePosition() was my thinking. You'd call this if isSeekable is false and you don't mind imprecise seeking. I also feel that seek should be changed to not attempt to seek unseekable files, since it just resets the position. That could be confusing to document and explain though so I like the ExtractorsFactory option. We'd like to implement this fairly soon so any other guidance you might have would be great. |
Ok after looking at this a bit more, it seems like the simplest change is to alter the The only minor downside is that this involves making our own |
If you look at I think we'd be happy to accept a pull request that does this, if you feel like putting one together. Once that's submitted all you'll have to do in your own code is to create your own |
Using ExoPlayer v2.2.0 and trying to play this file: sample.mp3 it reports as un-seekable. However this same file seeks fine in the Android MediaPlayer and various other players as well.
Doing an afinfo on the macOS command line doesn't seem to turn up anything interesting about the file:
This seems like a bug, but I'm unsure about where to hunt for whats going wrong?
Edit: Just to rule out our implementation I tried it in the sample project as well, same result, it disables the seek bar and buttons.
The text was updated successfully, but these errors were encountered: