New version of our AS3 open-source VideoPlayer
Hi there.
After some inquiries we finally added the possibility to customize the Apdev VideoPlayer – only changing colors at this time but it’s a first step in the right direction …
You can now change any color of any object/control that is used within the videoplayer – but check the ApdevVideoPlayerDefaultStyle.as for all the attributes that can be manipulated. And it’s up to you whether you change the attributes using pure ActionScript (1) or our html-version of the videoplayer and pass the values in via flashvars (2). With approach 2 you don’t even have to know ActionScript or open a flash-file – just embed the videoplayer-swf into your website and customize it via flashvars.
For further information, see the upcoming examples.
(1) If you want to use the VideoPlayer in a pure ActionScript project, you can create a new Styles-Object, set all the values you want to change. This object must then be passed into the constructor of the ApdevVideoPlayer and voilà … you got your own custom player.
Create your own Styles-object
package com.apdevblog.examples.style
{
import com.apdevblog.ui.video.style.ApdevVideoPlayerDefaultStyle;
/**
* Custom style-sheet for a custom VideoPlayer.
*/
public class CustomStyleExample extends ApdevVideoPlayerDefaultStyle
{
/**
* constructor.
*/
public function CustomStyleExample()
{
// player
bgGradient1 = 0x333333;
bgGradient2 = 0x000000;
//
controlsBgAlpha = 1.0;
//
btnGradient1 = 0x333333;
btnGradient2 = 0x000000;
btnIcon = 0x66ff00;
btnRollOverGlowAlpha = 0.2;
//
timerUp = 0x66ff00;
timerDown = 0x999999;
//
barBg = 0x333333;
barBgAlpha = 0.5;
barLoading = 0x333333;
barPlaying = 0x66ff00;
//
playIcon = 0x000000;
//
controlsPaddingLeft = 0;
controlsPaddingRight = 0;
}
}
}
Then pass it into the ApdevVideoplayer-constructor:
// create own style var style:CustomStyleExample = new CustomStyleExample(); // create videoplayer var video:ApdevVideoPlayer = new ApdevVideoPlayer(320, 240, style); // position videoplayer on stage video.x = 25; video.y = 25; // add videoplayer to stage addChild(video);
… and you’re all done.
(2) Second alternative: You can grab the html-version of our videoplayer from google code and adjust the .html file – no flash/actionscript needed.
// ...
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
// <![CDATA[
var width = 380;
var height = 240;
var movie = "htmlvideo.swf";
// ...
var flashvars = {};
// video + img info
flashvars.v = "video01.mp4";
flashvars.img = "videostill.jpg";
// STYLES
flashvars.playIcon = "#ff0000";
flashvars.controlsBg = "#ff00ff";
flashvars.controlsBgAlpha = 1.0;
// ...
swfobject.embedSWF(movie, replaceDiv, width, height, flashVersion, express, flashvars, params, attributes);
// ]]>
</script>
// ...
Sooo … there is no reason why you shouldn’t be already using our VideoPlayer :D
Check it out.
Or take a look at the docs first and then download the whole package.
Enough for now … but keep the feedback coming, we’re still eager to improve the player over time.
Cheers.
1 Trackback
-
Oktober 23rd, 2009 / 09:04
18 Comments
-
hi,
awesome work
but tell me if i want playlist so hw can i add some vedios with playlistthank u
-
Great work!! Saves much time! :]
-
Hey ! This code is very useful, thanks.
Anyway, i’m wondering i there is a way to play the video full-browser (i mean not full screen).
I tried to find more documentation, but … can’t find anything .Thanks again.
Ludo
-
Hi, I tried out the videoplayer you have created and I must say it is a nice, clean, and tiny player. I did adjust it visually but technically I am still trying to figure out why the controls are not fading out. I looked at the timer event but I could find an immediate solution. Could you please, whenever it is that you read this, just email or post may be a suggestion how to fix it. The controls do disapper when controlsAutoHide is set and the mouse leaves the player, but when the mouse remains within its boundaries the controls are always there. Cool would be too to implement an Event.MOUSE_LEAVE for the whole swf of the player is embedded….
However, you did a really nice work! Thanks a lot. I will try some more things to correct the auto hide functionality…
Cheers from Bremen
-
great work, but why are these stupid ugly green colors on the control ?
I have no time to configure hundreds of style parameters, before I can use the player.
Why not let the colors in default grey like the jerowing player ? -
hello phil,
thank’s a lot. without the neon green it’s very usefully….
-
Forgive this dumb question, but I am a noob. What IDE did you use to create this? I am trying to build this in Flex Builder, but I am having problems. I have all of Adobes tools, so I can use whatever would be easiest.
-
awesome thanks. In Flex, i think the Main class needs to be in the src folder, is ApdevVideoPlayer.as the Main class?
-
Hi Phil,
nice work, thanx.
Is it possible to add an skip-to-start-button to the player?regards
max -
If you refresh a site with the player in Internet Explorer, the player becomes very small!!!…(((
-
Please repair this!!!…
-
Hi Phil !
Im working on my thesis and would juse your Player.So I have a question does your Player streaming content?
Best regards
Frank
