-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
wait for user interaction before creating audio context #194
Conversation
} else return undefined; | ||
}; | ||
var loadTrack = function (params, autoplay) { | ||
if (typeof window.audioUnlocked == "undefined") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
Thanks for this PR!
Does this mean that the track is not loaded if the user has not made any interaction yet?
What happens if a user (re)connects to LMS? Currently the last played track is loaded, but the track is not automatically played
(about the reformatting I planned to switch to clang-format)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well you can't autoplay stuff, the problem was generally
var _audioCtx = new (window.AudioContext || window.webkitAudioContext)();
you will have to interact with the window before creating the context, that a rule in webkit based browsers, FF generally is a bit different having its own autoplay permission.
https://developer.chrome.com/blog/autoplay/#web-audio
about taht resume thing, I do remember from experience, safari browser as usual do their own thing and just tend to lock the whole audio/video.
I know the fix is not great, I just wanted to make as less changes as possible, about the formatting..sorry about that I just have a habbit to click reformat button all the time.
bottom line is never do autoplay of anything nowadays in browser, it is just a recipe for problems
I recently noticed that sometimes the media session is not working as intended (browsers do not display correctly the controls and the artworks). May be related to this? |
Thanks for your work, it seems to work fine (I just changed a few things) |
need to wait for user interaction before the audiocontext is created
if that is already made somewhere feel free to get rid of the PR, it just did not work for me at all, now it works, still trying to figure out the transcoding though.
#105