Archive for the ‘News’ Category

OSMF – Displaying an image before a video

Thursday, February 11th, 2010

This post will show you how to use Open Source Media Framework to display an image for 2 seconds before displaying a video.

To display an image for 2 seconds before your video starts you'll need to use a TemporalProxyElement to apply a duration to your ImageElement.

 
var temporalProxyElement:TemporalProxyElement
     = new TemporalProxyElement(2,
				               new ImageElement(new ImageLoader(),
					       new URLResource(THUMB_URL))
					      );
 

Full Code

 
package {
	import flash.display.Sprite;
 
	import org.osmf.composition.SerialElement;
	import org.osmf.containers.MediaContainer;
	import org.osmf.image.ImageElement;
	import org.osmf.image.ImageLoader;
	import org.osmf.layout.LayoutUtils;
	import org.osmf.media.DefaultMediaFactory;
	import org.osmf.media.MediaElement;
	import org.osmf.media.MediaFactory;
	import org.osmf.media.MediaPlayer;
	import org.osmf.media.URLResource;
	import org.osmf.proxies.TemporalProxyElement;
	import org.osmf.utils.URL;
 
	[SWF(width="400", height="300", frameRate="25")]
	public class ShrelpBurst extends Sprite
	{
		private var mediaFactory:MediaFactory;
		private var mediaElement:MediaElement;
		private var mediaPlayer:MediaPlayer;
		private var mediaContainer:MediaContainer;
 
		private static var VIDEO_URL:URL = new URL("http://www.marinelayerproductions.com/_uploads/news/portugal_killer_heat.flv");
		private static var THUMB_URL:URL = new URL("http://www.marinelayerproductions.com/_uploads/news/large/midnight_blue_04_00000.jpg");
 
		private var _pause:Sprite;
		private var _play:Sprite;
 
		public function ShrelpBurst()
		{
			mediaFactory = new DefaultMediaFactory();
			var serialElement:SerialElement = new SerialElement();
			var temporalProxyElement:TemporalProxyElement = new TemporalProxyElement(2,
																	new ImageElement(new ImageLoader(),
																	new URLResource(THUMB_URL))
																	);
			serialElement.addChild( temporalProxyElement );
			mediaElement 		 = mediaFactory.createMediaElement( new URLResource(VIDEO_URL));
			serialElement.addChild( mediaElement );
 
			mediaPlayer 		 = new MediaPlayer();
			mediaPlayer.autoPlay = true;
			mediaPlayer.media 	 = serialElement;
			mediaContainer 		 = new MediaContainer();
			mediaContainer.addMediaElement( serialElement );
 
			addChild( mediaContainer );
 
			LayoutUtils.setAbsoluteLayout(mediaElement.metadata, 400, 300, 0, 0);
		}
 
	}
}
 

Street Moffett Vs. Ramp Moffett (Round One)

Tuesday, October 27th, 2009

Matt Moffett is one of those all terrain skateboarders that can take you out in a game of skate. I decided the only fair competitor to Matt is himself. So lets how Street Moffett does against Ramp Moffett.


Here is round one, vote in the comments below and pass the link on to a friend.

On the left Ramp Moffett

On the right Street Moffett




That was round one, leave your vote in the comments and pass the link on to a friend.

Veoh to Bring Behavior to Video Ads

Monday, July 14th, 2008

AdWeek published an article on Veoh's in-stream advertising strategy and behavioral targeting system.
I've been working on the flash integration with our in-house targeting server add Freewheel's first ActionScript 3.0 SDK for ad delivery.

Check out the article
Veoh to Bring Behavior to Video Ads

How to set environmental variables in Unix

Wednesday, April 2nd, 2008

I often use SubVersion from the command line to manage my projects and I quickly became tired of typing in the full urls to repositories. I'm now storing these long paths in environmental variables. So for example I previously had to type
svn copy http://repo/svn/spoonermedia/projectname/trunk http://repo/svn/spoonermedia/projectname/branch/feature1 to make a branch. After setting up an environmental variable I only have to type

svn copy $R/trunk $R/branch/feature1

Okay if your sold on Environmental Variables this is how you do it.

  1. Look in "/Users/your-user-name" for a .profile or .bash_login file. If you have both then open up .bash_login or if you have neither create a .profile file.
  2. In that file you can use the export command to set all the variables you need. Each of these variables should be in uppercase.
    export W=/Users/jspooner/Documents/veoh/FlashPlayer/branches/wolverine
    export T=/Users/jspooner/Documents/veoh/FlashPlayer/tags
    export B=/Users/jspooner/Documents/veoh/FlashPlayer/branches
    export SVNROOT=http://repo/svn/src/FlashPlayer/
    

You can also use alias and functions to do other task like open and close projects. Here are some of the other shortcuts I have.

## Open my current project
alias wolverine="cd /Users/jspooner/Documents/veoh/FlashPlayer/branches/wolverine && pwd && echo WELCOME TO WOLVERINE"
# mate
alias edithost="mate /private/etc/hosts"

alias stopmysql="sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist"
alias startmysql="sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist"
#
# # functions
# # change directories. echo PWD and show a list
cdd () { cd ${1}; echo $PWD; ls; }

Installing Flex 3 Issues

Wednesday, March 5th, 2008

After installing Flex 3 form Flex 3 Beta 3 I had lots of issues with keyboard short cuts. I found that some hidden files from the beta were still on my system in ~/Documents/Flex Builder. I was able to solve all issues by changing the name on that directory and reinstalling Flex.

If your having issues and had Flex Beta installed check out these instructions from adobe. The worked for me when upgrading from Beta 2 to Beta 3.