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

Adds event triggering to callbacks #184

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

rtibbles
Copy link

@rtibbles rtibbles commented Dec 5, 2014

This pull request follows up on #137, to allow events to be listened to, rather than just overwriting default behaviours through setting of callback functions within audiojs.

Also fixes some regex that the closure compiler was incorrectly escaping.

@pangolingo
Copy link

Great pull request.

Testing on Internet Explorer 9, this fails. I get an error on the line

event = new Event(eventName);

Seems that syntax isn't supported in this browser.
Fixed by changing to

var event = document.createEvent('Event');
event.initEvent(eventName, true, true);

@pangolingo
Copy link

Also seeing issues on IE8: it seems custom events are supported, so "onplay" doesn't work.
I'm fixing by using jQuery to trigger events:

$(element).trigger(eventName, args);

Unfortunately this creates a jQuery dependency.

@CeloGomesBR
Copy link

Hi, good job.
I need this!
But, how can I use it in a multiple instances?
For example, how can I call an external function on play? I want to receive parameters too, like the exact element is playing and your currentTime (if 0 I will do A thing, if not I will do B thing).
Thank you,

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

Successfully merging this pull request may close these issues.

4 participants