Comments (14)
@xxneon I'm afraid I cannot reproduce this on my local machine using IE11 on Windows 7. It seems like play/pause events are fired properly.
Did you check that you're using the on
keyword rather than the one
keyword to bind event listeners?
from audio5js.
I am using on
. (via Angular) Also, I see the bug when viewing your demo page as well. http://zohararad.github.io/audio5js/
You have the audio set to loop and after it plays through once it won't pause. On my machine I traced the error back to when the listeners are added to the audio element itself.
from audio5js.
The play event is fired correctly when pausing and playing the audio, as per the HTML5 audio spec. Looping doesn't mean the audio needs to pause.
I'm can add the playing
event support to the HTML5 player if you need to hook into that event specifically, although I'm a bit reluctant to do so as mirroring this behaviour in the Flash version might be a bit of a stretch.
If you need to hook into a loop behaviour, perhaps you can use the ended
event?
from audio5js.
So you can't reproduce this odd behavior when you try to play an audio file more than once on IE11? (or if it loops automatically)
from audio5js.
It's not that I can't reproduce it, it's that checking a simple use case of play/pause fires the events correctly when playing / pausing multiple times.
Are you playing audio in a loop? What exactly are you trying to accomplish / build?
from audio5js.
Simple play/pause works fine form e as well. It's only when the audio finishes and you try to play the audio a 2nd time. The play/pause is broken if you replay the audio. It also breaks when the audio is set to loop. Your example page loops the audio and when it starts to loop the audio play/pause is broken.
All I'm trying to do is all the user to replay the audio. And forcing my code to destroy and recreate the audio just so i can play/pause when replaying the audio seems silly.
IE11 appears to only effectively dispatch the play
event the 1st time through. After it reaches the end and you replay the audio it doesn't dispatch play
events anymore. It only dispatches playing
events.
Sorry if that doesn't make sense.
from audio5js.
Ok... got it - So, would it be possible for you to post a simple example of your code that I can play with? I'll try to re-create the problem in IE11 and find a work-around / fix
from audio5js.
@xxneon So 8 months with no reply on whether you fixed the issue (with a code example of how to fix) or whether the issue was a false alarm.
@zohararad can you close this if xxneon does not respond within 24-48 hours?
from audio5js.
@KamijouTouma sure things, thanks for the reminder. @xxneon please let me know where this stands.
from audio5js.
To fix my issue I changed the following lines..
https://github.com/zohararad/audio5js/blob/master/audio5.js#L552
https://github.com/zohararad/audio5js/blob/master/audio5.js#L567
New Line 552: this.audio.addEventListener('playing', this.listeners.play, false);
New Line 567: this.audio.removeEventListener('playing', this.listeners.play);
All browsers that I tested dispatch play & playing events. Like I mentioned previously, IE11 correctly dispatches 'play' events during the 1st play of the audio. But when you replay the audio IE11 stops dispatching 'play'. IE does dispatch 'playing' all the time.
I propose changing the event listener to 'playing' since all browsers dispatch play and then playing afterwards.
Hope this helps.
from audio5js.
@xxneon So are you saying that when you click play after its done playing the browser sends 'playing' instead?
http://caniuse.com/#feat=audio-api
IE doesnt even officially support the web audio api anyway which is probably why the 'ended' event isn't even being fired in the browser (which is why IE always says 'playing'). Edge however (IE's replacement) Does officially support the web audio api. So in this case a fallback is required but in all honestly we need something other then flash for a fallback.
Even on this page https://dev.windows.com/en-us/microsoft-edge/platform/status/webaudioapi , IE clearly says its not supported and is even whited out in between firefox and opera.
@zohararad
What I'm wondering is why you don't have an event listener for 'playing' already anyway e.e?
Did you not care about the event or just forgot or didn't know about it?
Also flash needs to be fallen back upon if the browser is IE and not EDGE regardless if the user specifies a swf_path or not. (if its not already doing so.)
Or you can alternatively use the real audio element (not the API) http://caniuse.com/#feat=audio for IE 9 -11 only.
from audio5js.
@KamijouTouma the "playing" event must've slipped my mind. I wasn't trying to replicated the entire event spec, only the useful bits. I'm happy to add it though i need to see how to add it in the Flash version (maybe "play" followed by "playing" immediately)
from audio5js.
Yeah. The playing event is always fired immediately after play.
Also this issue should be closed based on the fact that the web audio api is not supported by IE at all. But only after an alternative has been chosen (either using real audio tag in IE 9-11 only or falling back on flash in all IE regardless of whether the user specifies an swf path or not).
@zohararad
from audio5js.
added support for "playing" event firing natively in HTML5 or after "play" event in Flash player. This should allow for selective implementation on annoying browsers. Hope this helps @xxneon
from audio5js.
Related Issues (20)
- Setting volume on ready event causes TypeError HOT 6
- Error when on https HOT 4
- one instance has issues loading multiple tracks HOT 4
- Playback speed support HOT 3
- Instance attribute 'position' is a formatted string. HOT 1
- milli seconds for progress HOT 4
- npm does not install latest release HOT 6
- Button to control sound in webpage HOT 3
- Angular implementation
- Catch HTTP response errors when loading audio? HOT 2
- Replay issue in IE8 HOT 1
- trigger 'canplaythrough' and 'stalled' HOT 1
- No Audio Android Chrome, But Full Audio Android Firefox?? HOT 13
- Uncaught (in promise) DOMException: play() can only be initiated by a user gesture. HOT 4
- fail to get audio duration directly HOT 6
- failed to pause playing immediately after this.play() HOT 3
- can laod Multiple songs at one time HOT 1
- any method to clear the event queue of specific event? HOT 4
- Uncaught (in promise) DOMException: play() failed because ... HOT 11
- Can't get info when loaded or play
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audio5js.