This is a message.

Looping and End on Frame Event Created Dec 21, 2011

This thread is solved

Views: 2628     Replies: 1     Last reply Dec 22, 2011  
You must login first before you can use this feature

unadventurer

Posts: 3

Registered:
Dec 9, 2011

Looping and End on Frame Event

Posted: Dec 21, 2011

Below is the code being used for an embedded video displayed on our index page. The video is supposed to play once and then display a previous frame with our logo.

It loops in all browsers except chrome and doesn't rewind to the specified time in any of them.

Any thoughts on why it's not working?

Here's the snippet:

/**
 * Home Page Video Player
 */
$(document).ready(function() {

	// don't do this stuff if we're not on the home page
	if ($("#homepage-theater").length == 0) return;

	// if HTML5 video support (and the "true" excludes IE9)
	if (videoElementSupport(true)){
		var $video = $("#homepage-theater video");

		// setup play/pause click behavior
		$video
			.attr("title", "Click to pause video")
			.click(function(){
				if (this.paused){
					this.play();
					$(this).attr("title", "Click to pause video");
				}
				else{
					this.pause();
					$(this).attr("title", "Click to play video");
				}
			});

		// rewind to slogan frame and stop
		$video[0].addEventListener('ended', function(){
			this.currentTime = 0;
			// this.currentTime = 15.9;
			// this.pause();
		}, false);

	}

	// Flash fallback using Flowplayer
	$("#homepage-theater .flash-fallback a").flowplayer(
		{
			src:"js/flowplayer/flowplayer-3.2.7.swf",
			wmode:"opaque",
			bgcolor:"#ffffff",
			quality:"autohigh"
		}, 
		{
			clip: {
				scaling: "fit",
				// loop
				onBeforeFinish: function () {
					return false;
				}
			},
			plugins: {
		        // controls: {
		        //     url: 'flowplayer.controls-3.2.5.swf',
		        //     fullscreen: false,
		        //     backgroundColor: '#0093c0'
		        // }
		        controls: null
		    }

		}
	);

	
});

unadventurer

Posts: 3

Registered:
Dec 9, 2011

» Looping and End on Frame Event

Posted: Dec 22, 2011

Reply to: Looping and End on Frame Event, from unadventurer
Any admins wanna help me tackle this one? I'll resort to begging if I have to.

The video is athttp://teamreva.com/