Created
September 18, 2014 15:35
-
-
Save bschaeffer/db3d1fd5cd9e0f307cd9 to your computer and use it in GitHub Desktop.
Flash to Javascript Callbacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Embed the player | |
swfobject.embedSWF url, 'BIVideoPlayer', width, height, swfVersion, xiSwfUrl, | |
callback: 'customCallback' | |
playerId: 'BIVideoPlayer' | |
# Flash Event Handler | |
window.customCallback = (event, playerId, data) -> | |
selector = "#" + playerId | |
jQuery(selector).trigger(event, data) | |
# Define Events | |
player = $('#BIVideoPlayer') | |
player.on 'playerStart', (data) -> | |
# do something | |
player.on 'playerEnd', (data) -> | |
# do something |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment