Animation stuttering on website

Hi there,

I made this website for our YouTube channel with Hype and wanted to create a nice intro animation. This is the site:
And while Hype plays the animation very smoothly, pretty much every browser on a PC or Mac I open the site with, stutters heavily. This obviously doesn’t look nice.
I thought that this might have to do with the YouTube content loading in, therefor I already made two pages in Hype, one which only contains the intro animation in the timeline, and the other being the actual site with the YouTube video. After the first site is finished it fades to the second page - this all works beautiful.
But I still can’t figure out what makes the intro animation this slow. I animated the position, the opacity and the 3D rotation on all of the elements. Is this too much? All the header elements are small png files. Could that be a problem, or is the page still loading stuff in the background while the animation plays?
Do you guys have any idea what I could try to make this animation silky smooth? :wink:

Thanks in advance


Can you post the zipped project so we can look at it. This may help use diagnose the issue rather than just looking at the result.


Of course. Here is the zipped Hype file. I deleted a few of the unimportant pages, as the file was too big otherwise. (292.6 KB)


To me it looks like it is all the video iframe that are slowing everything down.

I removed all the iframe video elements and the animation was ok.

You probably should only have them load as needed.

This seems to help.

Remove all the youtube video elements from all the scenes except the first scene ‘Home 2’

set the element’s innerHTML '<iframe width="640" height="360" id="youtubevid" frameborder="0" allowfullscreen=""></iframe>

Make the element into a persistent symbol - add to all scenes.

Now set each scene to load this function

	var videoScenes = {"Home 2":';rel=0&amp;showinfo=0&amp;hd=1&amp;autohide=1&amp;color=white',
						"What really happens":';rel=0&amp;showinfo=0&amp;hd=1&amp;autohide=1&amp;color=white',
						"Star Wars":';rel=0&amp;showinfo=0&amp;hd=1&amp;autohide=1&amp;color=white',
						"Mission Impossible":';rel=0&amp;showinfo=0&amp;hd=1&amp;autohide=1&amp;color=white',
						"Game of Thrones":';rel=0&amp;showinfo=0&amp;hd=1&amp;autohide=1&amp;color=white',
						"Battlefield": ';rel=0&amp;showinfo=0&amp;hd=1&amp;autohide=1&amp;color=white',
						"Ben vs Dan" : ';rel=0&amp;showinfo=0&amp;hd=1&amp;autohide=1&amp;color=white',
						"Golden Candy" : ';rel=0&amp;showinfo=0&amp;hd=1&amp;autohide=1&amp;color=white'}
	var sceneName = hypeDocument.currentSceneName();
	var iframe = hypeDocument.getElementById("youtubevid"); 

and to run this function on unload.

var iframe = hypeDocument.getElementById("youtubevid"); 
	 iframe.setAttribute('src', '')

I have updated the load code to be much simpler using an Array like object

1 Like

Thanks a lot!
I will try to implement the code right now. I was away from the computer for one day.
I’ll update this post, as soon as I have some results.


I did everything you described above and the video does load on the first page. As soon as I try to view a video on another side though, the player won’t load.
Safari tells me the following:
Error in loadYouTubePlayer: TypeError: null is not an object (evaluating ‘iframe.setAttribute’) (HYPE-530.thin.min.js, line 14)
Could this have to do with the DOM not being loaded on the other pages when the browser tries to load the JS function?

Edit: Ok, now it works. I apparently forgot to delete the ID from the persistent symbol.

Edit2: Everything is up and running perfectly. And yes, the animations are silky smooth on all the devices I tested them on:
And I even learned something! Thanks so much! :grinning: