Trying to create a toggle button to pause Video and Animation

This took several iterations, but posting and to the board and reading it helped me resolve some issues.
So, this code works. It pauses the video AND the animation. I am sure everyone figured this out before, so I hope you don't mind me posting it:

switch (element.innerHTML) {
	case 'Pause':
	element.innerHTML='Play';
	hypeDocument.getElementById('video1').pause();
	element.style.backgroundColor='#FE9470';
	hypeDocument.pauseTimelineNamed('Main Timeline');
	
	break;
	
	case 'Play':
	element.innerHTML='Pause';
	hypeDocument.getElementById('video1').play();
	element.style.backgroundColor='#00F44B';
	hypeDocument.continueTimelineNamed('Main Timeline');		
	break;

Still looking for DOM reference for all hypeDocument.

1 Like

I'm guessing from your other post you found it?