February 23rd, 2008 . by polyGeek
Here is a short - 6 minute - video tutorial to help you create rollovers effects for your video interface controls.
[ Download Example | Download FLV ]
If you want to use the new API call - playBackward() - mentioned in this video you’ll need the latest videoMaru 3.5 beta SWC - see link at top of window.
playBackward( mc ) works be taking the MovieClip that you pass and creating an onEnterFrame function. On each enterFrame event it says: gotoAndStop( this._currentframe - 1 );
Then it checks to see if this._currentframe == 1. If so then it deletes the onEnterFrame function.
It looks like this:
function playBackward( mc:MovieClip ):Void { mc.onEnterFrame = function():Void {
this.gotoAndStop( this._currentframe - 1 );
if( this._currentframe == 1 ) {
delete this.onEnterFrame;
}
}
}
Posted by: polyGeek in Controls, Video Tutorials, examples |
1 Comment »
February 18th, 2008 . by polyGeek
The startPlay button has gotten a major update. When you use it it not only pauses the video playback but it also stops the NetStream. Meaning that there is no video downloading until the user begins playback.
That comes in very hand here on my blog where I have multiple videos on the homepage at any given time. I don’t want to needlessly have those videos downloading if the user isn’t going to watch all of them. And that takes a huge burden off my server.
Here’s an example. Watch for the download progressBar closely when you click play. You should see it grow quickly even though the video has been sitting there for a few minutes.
Here’s how it works. For progressive streaming once the NetStream starts downloading a function runs that takes a Bitmap snapshot of the current frame visible in the videoWindow. Then it kills the NetStream so that no more downloading can occur. If everything has worked correctly the user will never know because they will still see one of the first few frames of the video sitting there.
Sometimes the Bitmap snapshot happens before any video is rendered so the user would see a blank screen. I’m working on that.
When the user starts playback the NetStream is recreated and downloading begins.
This should work with RTMP streams as well but there might be a few bugs. And it doesn’t apply to MP3s at all.
Posted by: polyGeek in Controls |
2 Comments »