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

seek no longer works in 2.1.0 #1101

Closed
smakinson opened this issue Dec 14, 2018 · 14 comments
Closed

seek no longer works in 2.1.0 #1101

smakinson opened this issue Dec 14, 2018 · 14 comments

Comments

@smakinson
Copy link

Updating to 2.1.0 causes seek(position) to no longer work. It always plays from the start. If I revert to 2.0.15 it works again. I am using html5: true and format: ['mp3']. Setting the html5PoolSize to 0 did not resolve the issue. I have the same result in chrome & safari.

@goldfire
Copy link
Owner

Can you provide sample code demonstrating the issue?

@smakinson
Copy link
Author

Sure. If I switch between 2.0.15 and 2.1.0 in the pen I get different results when I press seek.

https://codepen.io/smakinson/pen/maPRNe

@ardeois
Copy link

ardeois commented Dec 17, 2018

I've got the same issue and found the problem.
See #1102

@ardeois
Copy link

ardeois commented Dec 18, 2018

@smakinson If you change your codepen howler version to my branch it should work. Can you confirm?

https://cdn.jsdelivr.net/gh/ardeois/howler.js@610ed0c02f07680fd4e73a87cc6ebed8ab273188/dist/howler.min.js

@smakinson
Copy link
Author

@ardeois Looks like that fixes it!

@paulrosen
Copy link

I think you can also pass the id back in when calling play the second time:

var howl = new Howl(...);
...
var id = howl.play();
...
howl.pause();
...
howl.play(id); // will not start back at beginning.

@ardeois
Copy link

ardeois commented Dec 18, 2018

Good point, it should work. However it looks to me like a workaround on a regression

@goldfire
Copy link
Owner

This should now be fixed with d22ddcf.

@smakinson
Copy link
Author

Thank you for addressing this so quickly!

@stevenleeg
Copy link

stevenleeg commented Jun 25, 2019

Has this issue come back again? I'm noticing calls to seek always causing the playhead to reset to 0 in v2.1.2 with html5 set to true.

@Mani7TAM
Copy link

Mani7TAM commented Aug 27, 2019

I am also facing this seek issue in chrome and opera using version 2.1.2. But working without issues in firefox.

@tsukinose81
Copy link

Version 2.2.3 also has this problem. It works normally in firefox

@JoshKasap
Copy link

I found the url that you get your audio file from needs to include the response header Accept-Ranges: bytes in order for the seek and duration counters to work properly in chrome.

IDK how you do this using other languages but for cold fusion you need to add <cfheader name="Accept-Ranges" value="bytes"> to the top of page that returns the audio file.

For more context that might help people.
In my case the url I provided to howler was not a direct path to an audio file but instead a path to a page that would accept certain url parameters which would in turn be used to search a db and return the file. So I just needed to add the Accept-Ranges: bytes header to the top of this page that returned the audio file. Hopefully this information can be used to help determine the solution to this issue in more commonly used languages.

@artshade
Copy link

artshade commented Mar 1, 2023

Accept-Ranges: bytes

That was it! The same exact issue: from direct path to a custom reference - missing header.

Holy smokes... You are a hero... Ha! Thank you very much! Hurray!

Please have a pleasant time and stay safe! ✨

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

Successfully merging a pull request may close this issue.

9 participants