Closed thoughtpalette closed 8 years ago
here's the code handling onStateChange
: https://github.com/brandly/angular-youtube-embed/blob/master/src/angular-youtube-embed.js#L156
here are specific events you can listen for: https://github.com/brandly/angular-youtube-embed#events-and-player-controls
i believe you should also be able to $watch
player.currentState
, if you'd like to hear about all of them: https://github.com/brandly/angular-youtube-embed/blob/master/src/angular-youtube-embed.js#L162
hope this helps!
I think I actually may be able to do my tracking with the specific events you've linked. Was trying to migrate my old tracker script to this module.
Thanks for your help and answers! Especially on a Sunday! :}
Trying to run methods depending on state.
I've tried
$scope.$on('youtube.player.onStateChange', function( $event,player)
$scope.$on('youtube.player.onstatechange', function( $event,player)
$scope.$on('youtube.player.events.onStateChange', function( $event,player)
$scope.$on('youtube.player.eventsonstatechange', function( $event,player)
I do see the event available in the player Object
player.b.c.events
in console.Wondering how to capture global events on the player.
Any help would be appreciated :}