NamPNQ / bower-videogular-youtube

Videogular `youtube` plugin repository for distribution on `bower`
MIT License
41 stars 32 forks source link

Digest cycle constantly triggered #52

Closed PierrickGT closed 5 years ago

PierrickGT commented 8 years ago

I was gonna implement a directive to watch the scroll position and decided to test if this directive would have negative effects on the performances.

At my surprise, I found out that videogular is constantly watching and triggering the digest cycle.

Here is a Codepen to show you the problem: http://codepen.io/PierrickGT/pen/qbJawX

Is there a workaround?

Elecash commented 8 years ago

The digest cycle must be triggered by this setInterval.

https://github.com/NamPNQ/bower-videogular-youtube/blob/master/youtube.js#L111

You can try to clean the interval if player is paused, but you still need the interval to update current time value inside Videogular's API.