Custom Flv Player - How To?
Hello - I'm very curious about how to best replace the standard video players that are included with Flash 8 Pro with a custom player. I'm able to alter the controls to whatever I'd like; however, the actual "videoplaceHolder" is the element that I'd like to be able to customize. Insert a video on a flat panel plasma tv for instance, or on an image of a laptop screen, etc.
Any suggestions out there on how best to handle this? Thanks for any/all insights (from a 1st time poster!)
ActionScript.org Forums > Flash General Questions > Flash 8 General Questions
Posted on: 09-16-2006, 06:47 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Custom Flash Player (not Flv) Working With Custom Flash Content
I am working on a custom player of swf content. Some of the content the player loads and plays is custom Flash content (swf files) such as games.
Depending on how the external content is built, sometimes the pause button for the player will not pause everything in the loaded content swf.
Does anyone know of a standard approach to such a problem?
Thank you.
Custom Mp3 Player
Ok. I've built a custom mp3 player class which extends the sound class and creates play/pause, skip, and mute buttons. I also have a dynamic text field where I would like to place id3 information for each track which is loaded from an xml file. I'll provide a snippet of code and then explain my problem
Code:
//contained inside of public function nextTrack
var self = this;
this.onID3 = function() {
trace("ID3 Content Available");
trace(id3);
for(var i in id3) {
trace(id3[i]);
}
}
so when I run my app i get this for trace information
Code:
ID3 Content Available
[object Object]
so what's the deal. It doesn't want to itterate thru the object properties. If I try to access any property specifically it spits an error saying property doesn't exist. However, as stated, the onID3 event is firing so id3 tag information is available. I've tried using self.id3, self.ID3 (returns undefined), and just ID3 (also returns undefined). I'm really at a loss here. Any help is appreciated
Custom FLV Player
Hi,
I have a working semblance of a beta flash player I created (through the help of course of Lee Brimelow from his website). You can see a working copy of my flash player at the following link:
CogVent Videos
My end goal is to be able to control the flv player by clicking on the randomly generated pictures from the php recordset. I do of course have links inside this recordset to the location on my server of the flv files. But of course, you cannot just take a picture and link it to the location of your flv file and expect it to play in your flv player.
Can someone help me learn how to do this? From everything that I have read, it seems that this would be accomplished through the use of javascript and the ExternalInterface class. I am using Macromedia Flash Professional 8. If you would like to see the actionscript of my flash player, here it is:
//begin actionscript
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
rewindButton.onRelease = function() {
ns.seek(0);
}
playButton.onRelease = function() {
ns.pause();
}
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 190.9;
loader.scrub._x = ns.time / duration * 190.9;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,-101,this._y,87,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader.scrub._x/190.9)*duration));
}
var vlist:XML = new XML();
vlist.ignoreWhite = true;
vlist.onLoad = function() {
var export:Array = this.firstChild.childNodes;
for(i=0;i<export.length;i++) {
videoList.addItem(export['i'].attributes.vid_title,export['i'].attributes.vid_filename);
}
ns.play(videoList.getItemAt(0).data);
videoList.selectedIndex = 0;
}
var vidList:Object = new Object();
vidList.change = function() {
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
}
videoList.addEventListener("change",vidList);
vlist.load("
Custom Player
http://www.psyop.tv/main.php if you click on a link and then click on the names to play the miller movie, these guys have an awesome player. is it diffucult to do something like that
Custom Player
How can I make A playlist in flash like Windows Media Player. If any one have answer please help me by giving your answer.
Custom Flv Player
I have a designed a player interface. Now, how do I create custom flash player ? I don't want to use third party tools/players.
Thanks
Photoshop For Custom Player
Hello, This is my first post to flashkit. I have read this forum for several weeks now and find it extremely helpful.
My Problem is this- I have created several photoshop video player skins or images or whatever the corect term is. I would like to load the movie inside the PSD file which has been converted to png32 and imported to an empty stage.
heres what I have done- Started a new MX2004-- Imported to stage my photoshop image- dragged mediaplayer component onto my desired viewable area on photoshop image. Aranged the media component so it is brought to the front. Added the controls and set the appropriate porperties to control the movie.
I get the movie and control of it but it is behind the image and not visable- I have searched for about 4 days solid and have not found my solution. I am sure it is a newbie question but I am baffled.
Please help?
Thanks
Creating Custom Flv Player
I am trying to create my own custom video player. I have a working version that passes the flv file name in the URL using swfobject. Works fine with the standard FLVplayback component.
But now I am trying to combine this code with my custom FLV player. Can't seem to get it right. I know I have to get the string to connect to the NetStream.
Code:
var video:String = flv;
var caption:String = flv;
my_FLVPlybk.contentPath = "../video/"+video;
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns :NetStream = new NetStream(nc);
my_FLVPlybk.attachVideo(ns);
my_FLVPlybk.play();
mcPause.onPress = function() {
ns.pause (true);
}
mcPlay.onPress = function() {
ns.pause(false);
}
playMovie();
[F8] Custom FLV Player Problem
I tried and I tried and I couldn't think of anything, so I got stuck with this annoying problem...I customized one of the flash video players that go with Flash (the SteelOverAll)...and I wanted to make the video controls invisible and on every rollover on a certain hit area they would appear...Everything on these controls is separate, all the buttons, all the stuff that makes the video controls is separate...I couldn't make it into one symbol, cuz then they won't work. So I figured maybe I should try and type my action script for every single symbol of the controls to make it work...and I did...kinda...my action script for my first symbol of the video controls works fine. But now I figured out that this action script doesn't work with the control buttons...and that's a problem. The buttons themselves are actually different MovieClips and every state of a given button is a movie clip. And now I don't know how to make my "alpha=0 on rollout/alpha=100 on rollover" script work with these buttons. Any suggestions?
Custom Video Player
Hi everybody!
I have a question regarding a custom video player in AS3.
What I want to do is to add to my video player a dropdown menu which
will display a list of videos for user to choose from. And since there is a possibility that after the file is published, new video files will be added to the
directory in which the SWF will reside, I need this dropdown menu to be
populated automatically. The chain of events should go like this: on the
website there will be a button. Clicking on that button opens up the video
player and at the same time gives a command to SWF to scan the directory
in which the SWF sits, for files withe FLV extention. When done scanning, any
video files that are found should uppear in the dropdown menu of the video
player.
Can anyone please thell me how this can be done?
Thanky in advance!
Custom FLV Player Query
Dear all
I have created a custom FLV player and i would like to embed it into our web site. The problem I have is I want it to be dynamic. So I can link lots of videos to it rather than export just one movie with the player from flash and embed that each time into the website. I want the player as a permanent entity and then link to it via a database with a list of FLV videos. I know about Flashvars and creating those variables in the javascript file but I want to know do I need to or can I type a query into the source field in the parameters of the .fla file to link to a database full of the videos. Rather than place in that source field the name of one .flv movie. Thats where I am stuck. I am pretty new to flash. I am using progressive download by the way.
Our website is coded with classic ASP/CSS and we use access for databases.
Many thanks
Rob
Custom Player Skins?
Hello, I'm working on creating a flash movie to be displayed on a webpage and I'm wondering if there are any options out there for creating a custom player skin?
I've never tried creating a skin but I was wondering if Flash gave you any options for that or if there was a different Adobe software you would suggest?
Thanks so much for your help!
Custom Flash Player
Hello all,
I am VERY new to Flash, but have followed some tutorials, and somehow, feel that I may be close to finishing a custom Flash video player. Got some good tips from another user, and now have a few more questions...
I created a skin in PS, then imported it to Flash, and followed instructions to create the ActionScript. I finally got 3 files to publish to a folder: SWF, js, and html.
1. Not sure if my skin is included in these files - and don't know how to check.
2. What do I do now - to make this work on my site. No where in the tutorials I have watched (and there have been quite a few) or in the Flash Help index has any indication of what to do next - to make this thing fly on my own website.
I am using Wordpress to post - and have a host that has been solid with video playback in a gemeric video player.
Any help is much appreciated.
Custom Video Player
I deeply apologize for my ignorance in regards to Flash, saying that there is an issue that I'm having and that is, when I bring a embedded video component on to my stage, weather it's a video 8 player or display,for some reason or another, when I go to 'test' my movie, the video isn't showing up. I have pointed to the path and url and I have placed the fla in the same path as the flv, but I get nothing.... Can someone PLEASE give me some guidance and/or direction. WHAT I'm ultimately attempting to do is create somewhat of a video player sort of like the one that's on the front (home) page of ADOBE's webiste. You know, were it reads 6 of 6, meaning the 6th video of video total video and once you click it, that video is played in the player or window.....Thanks so much for the info and knowledge.....
Jaythan
p.s. Also, I need to know if there is a component out there that I can download and pull up in flash in regards to the scrollbars...? I want to add scrollbars to certain areas of the page that contains a lot of text.... The scrollbar that I'm interested in are the modern pill shape ones with the aqua color sort of like the ones ADOBE uses......Text
Using CuePoints With A Custom FLV Player
hi there
i was wondering if anyone out there has had any success using .as scripts associated with the flvplayback component without using the component itself?
i am trying to utilise the functionality of scripts such as CuePointManager.as, associated with flvplayback, with a custom flv player (essentially an empty movieclip video placeholder and custom-built controls).
if anyone has any examples or suggestions on how to ease this process (or even if it's possible) please let me know
ta muchly,
kam
Custom FLV Player I Created
I am putting thi out there because I know there has to be a better way to do what I am about to describe below.
I created a player that that uses the NetSctream connection to play videos I have stored on a server.
I want to make the player perform like Windows media player or Quicktime. Let me explain.
Right now my player has the path to the video file it needs to play hard coded into it. Therefore if I have 100 different videos - I have to save my player with the individual paths 100 times. Got me so far? I hope!
What I want to do is have only one player. I want a when a user wants to watch a video it they click the button to get the video - and intern it will call the player.
The reason for all this is simple. Say 4 years down the road I want to change the player loof and feel. Well if I have 1000 or 5000 independent video players you can see how impossible it becomes.
I want when I make a change to the player look and feel it applies to everything.
If you need better clarification let me know.
Can't Get Flv To Play In Custom Player
Hi, thanks for reading ....
I'll do the best I can to explain the problem, but I'm not sure posting the code at this time will help.
I'm building a portfolio web site. In the portfolio part, where actual examples of my work are to be displayed, I have it set up via an XML function from a tutorial I found on building a slideshow. On the stage is an empty movieclip called "myHolder". When you click on the portfolio button in the main movie, a submenu appears with several headings(movieclip buttons), such as print, design, direct mail, etc. When you click on, say, print ads, external thumbnail jpgs are loaded into the lower portion of the main stage, while the first external large size example of the group is loaded into the upper part of the main stage. This is all fed into the main movie from an external xml document. Each time you click on one of the thumbnails, that thumbnai's corresponding larger swf is loaded into the upper portion of the main stage in the "myHolder" movieclip. As I mentioned, I've made all of the larger examples into swfs. And each group of thumbnail jpgs and corresponding larger swf examples, are all kept in separate directories.
Everything works fine, except for the videos. I've made a custom player with the proper code calling the NetConnect and NetStream. When I run the main movie locally, the video player loads fine and the videos play as they should. But when I upload everything to the server, the flv doesn't play. The button rollOvers function, but I don't think the actual functions I placed on the buttons(which are movieclips) are working.
Oddly enough, when I use the built-in video player component that comes with Flash within the individual swfs that are to be loaded dynamically, the video plays remotely in the main movie, however I then also lose the included controls that come with the component. So obviously that won't work, plus I would rather use my own player.
I know this is an addressing problem, but I haven't been able to decipher it for two days. Obviously, I'm not a real Flasher; I'm just trying to do something nice for my little freelance business.
To see the problem in action, Please go here and click on "portfolio" >> "Motion Media".
Sorry for the long post. I'd be happy to post the code if the would help you understand the problem. If anyone can offer a suggestion, I would sure appreciate it.
Thanks very much,
bfg
Trying To Create Custom FLV Player
I have videos that I converted to FLV, now i want to create
my own custom video controls with a slide bar.
I would like the controls to be reuseable and use a php script to pass the correct movie to use.
I found VideoSpark Player (www.videospark.com) which is great (it uses xml file to tell what video to play), however I would like to change the controls to match my website.
If anyone knows of a tutorial or an already finished application even if it needs to be purchased, please let me know.
Thanks in Advance
Mike
How To Create A Custom FLV Player?
I tried following this tutorial:
http://www.communitymx.com/content/a...ge=2&cid=12EBE
But ended up only with this error everytime I click the play/pause buttons.
1000: Unable to make connection to server or to find FLV on server
Anyone has a solution or a better tutorial in creating custom FLV players for Flash 8?
Cheers.
Custom List Box For Mp3 Player
http://www.gotee.com/host.php
im trying to find out how to generate a custom listbox for my flash mp3 player like the one above. the standard listbox component in flash is ugly !!!! any help is appreciated
Creating A Custom FLV Player?
Quesiton: I am building a portfolio website for my motion design and I wish to use a flv as a format for my videos and play them in a custom player.
I have seen a plethora of flash video players on the net. I saw the turtorial about using the FLVPlayback component, but I was wondering if there's a tutorial to build a custom player from start to finish.
For Example: http://www.3ringcircus.tv has a very simple player I really like. Any advice would be welcome. Thanks in advance.
Scrub Bar For Custom FLV Player?
So I have a copy of the actionscript 3.0 cookbook... trying to figure out the scrubby code ...
using the actionscript 3.0 cook book I come up with:
Code:
import flash.display.Sprite;
import flash.net.NetStream;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Rectangle;
var scrubber:Sprite = new Sprite();
addChild(scrubber);
scrubber.x = 244;
scrubber.y = 268;
var track:Sprite = new Sprite();
track.graphics.beginFill(0xCCCCCC);
track.graphics.drawRect(0, -2.5, 79, 3);
track.graphics.endFill();
scrubber.addChild(track);
var mScrub:Sprite = new Sprite();
mScrub.graphics.beginFill(0x666666);
mScrub.graphics.drawRect(-3, -5, 10, 10);
mScrub.graphics.endFill();
scrubber.addChild(mScrub);
mScrub.addEventListener(MouseEvent.MOUSE_DOWN, onThumbDown);
mScrub.addEventListener(MouseEvent.MOUSE_UP, onThumbUp);
stage.addEventListener(MouseEvent.MOUSE_UP, onThumbUp);
var scrubbingOn:Boolean;
var stream:NetStream;
var duration:Number;
function onThumbDown(event:MouseEvent):void {
scrubbingOn=true;
var scrubberBounds:Rectangle = new Rectangle(0, 0, track.width, 0);
mScrub.startDrag(false, scrubberBounds);
}
function onThumbUp(event:MouseEvent):void {
scrubbingOn=false;
mScrub.stopDrag();
}
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void {
if(duration > 0) {
if(scrubbingOn) {
stream.seek(duration * mScrub.x / track.width);
}
else {
mScrub.x = stream.time / duration * track.width;
}
}
}
Returns no compiler errors.... I get the scrub bar... but it doesnt work... it just slides back and forth. I know its problaby something simple that is missing and one of you advanced flash coders are snickering and making fun of me under your breath but thats fine... I give full persmission to make fun of me if you help me figure this out.
the actionscript cookbook is no more clear than a forum post, clears nothing up for me...maybe i need actionscript for dummies and not a cook book
---------------------------------------------------------
anyone see my problem in the above code?
Custom FLV Player And XML PList
I followed the tutorial Lee did for Lynda, FL8 and made the custom FLV Player and when I try to use XML Playlist I can't get it to connect.
I am trying to figure out what to change to get both to play together. Here is what I had been thinking:
This is the top code for the flv player:
//-----NETCONNECTION SETUP----------------
var nc:NetConnection = new NetConnection();
nc.connect(null);
//-----NETSTREAM SETUP--------------------
var ns:NetStream = new NetStream(nc);
ns.onStatus = function(info) {
if(info.code == "NetStream.Play.Start") {
progressBar.onEnterFrame = videoUpdate;
}
if(info.code == "NetStream.Play.Stop") {
delete progressBar.onEnterFrame;
}
}
ns.onMetaData = function(info) {
ns.duration = info.duration;
}
//-----ATTACHING NETSTREAM----------------
video.attachVideo(ns);
//-----PLAYING EXTERNAL FLV---------------
ns.play("video.xml");
Custom Class For A Flv Player. Help Please
need to create a simple custom class for video player. I can create it in the timeline but don't have a lot of experience in creating custom classes. Any help on guiding me would be greatly appreciated.
Custom Video Player
Hello, I would like to create my own custom video player for my embeded videos. I have a phpbb3 forum with videos embed from sites such as youtube and google video etc. I would like to make my own custom video player for the videos I have embeded. I have watched the Video Player Interface tutorial but I need a few more functions.
The functionality of the player would need to include: Play/pause button, stop button, slider bar of time elapsed and time elapsed counter, full screen button, volume slider and mute button.
Is there a complete tutorial somewhere? And also, once the player is built, how do I incorporate it into my phpbb3 forum so that my embeded videos will use it?
Thanks for your help!
Custom Music In Flashtrax Player
The FlashTraks player reads from a file called data.swf, that has the music embedded in it. I need to know how to put my own music into an swf file so it will work with the FlashTraks player. I have tried many things and there must be some kind of actions that are in the data.swf that i cannot figure out.
Here's the link to the FlashTraks page where you can get the .fla if you dont already have it:
http://www.flashkit.com/movies/Third...2907/index.php
Custom Video Player Issues
Hi there.
Finally managed to find a pretty good tutorial on how to create custom video players in flash mx 2004 pro. It can been seen here:http://www.creativecow.net/show.php?...melow_lee.html. There are many stages to this video tutorial and it is explained clearly with the use of step by step video instructions.
On to my problem...
I have followed steps 1-5 of that tutorial and I have my video plaer working fine.
The problem I have is when I have more than 1 video players within the 1 flash movie.
I have attached my fla and video files for reference.
On the first frame of the movie I have the custom video player movieClip that I have made using the tutorial outlined earlier. I also have a button to advance to the next frame where I have a similar setup.
I have renamed the instance name of the video player movieClip on the second frame also.
As I said before this all works fine. You can play the movie, advance using the scrubber bar and pause the movie. This is fine for both of the video players on frames 1 and 2 of the main movie.
The problem occurs when you have viewed both movies and wish to see them again. By clicking on the button on the second frame takes you back to the the previous frame of the main flash movie. It is here where the problem occurs.
The video player will still play the flv and you are still able to pause it, but the scrubber bar does not work properly. It is very jerky and you cannot drag it properly. Any ideas why?
I read somewhere that you must close the net connection when you have finished using the player and clear the video object. I have tried to implement this in the flash movie supplied, but it makes no difference. Have I done this correctly and have is there anything else I need to do to get the scurbber bar on the video player working properly each time you view it?
I believe that there is not a lot of information out there on creating your own custom video players and most of the code for the scrubber bar part of it is undocumented e.g. the onMetadata handler.
As I said, I have attached my source files, so you should be able to see what I am trying to achieve if I have not explained it clearly enough.
Any help would be greatly appreciated.
Cheers,
James.
Custom FLV Player Scrubber Issue
Hi Everyone,
I have a custom FLV player, and everything is working great except for one small issue with the scrubber. 90% of the time it works totally fine, but if you click on it and scrub back and fourth a number of times (Sometimes as few as 1-2, sometimes as many as 30-40) it will fire the "NetStream.Play.Stop" info.code before you even let go of the scrubber, which in my case is causing an animation to play over the video.
My scrubber code is:
Code:
ns.seek(Math.floor((player.scrub._x / 325) * duration));
Has anyone else encountered this, or can you think of what might be causing it? I can post more code if needed. All ideas are very much appreciated.
Thanks,
Luke
Custom Player Skin Problems...
I've searched everywhere and I couldn't find 1 place that explains how to make your own skin.. I tried editing a basic skin but I'm having problems...
http://www.seo-leaders.com/alex/cast2/watch.html#nogo
As you can see:
1) the play button's background (which belongs to the outline) appeares pixelated although I drew it in vector.
2) The progress bar does not stretch all the way across the player for some reason (I checked and both right and left anchor are marked with true).
3) The volume bar leaves the player from the right (anchor right is true).
What could cause this?
Custom Video Player Issues
Hi there.
Finally managed to find a pretty good tutorial on how to create custom video players in flash mx 2004 pro. It can been seen here:http://www.creativecow.net/show.php?...melow_lee.html. There are many stages to this video tutorial and it is explained clearly with the use of step by step video instructions.
On to my problem...
I have followed steps 1-5 of that tutorial and I have my video plaer working fine.
The problem I have is when I have more than 1 video players within the 1 flash movie.
I have attached my fla and video files for reference.
On the first frame of the movie I have the custom video player movieClip that I have made using the tutorial outlined earlier. I also have a button to advance to the next frame where I have a similar setup.
I have renamed the instance name of the video player movieClip on the second frame also.
As I said before this all works fine. You can play the movie, advance using the scrubber bar and pause the movie. This is fine for both of the video players on frames 1 and 2 of the main movie.
The problem occurs when you have viewed both movies and wish to see them again. By clicking on the button on the second frame takes you back to the the previous frame of the main flash movie. It is here where the problem occurs.
The video player will still play the flv and you are still able to pause it, but the scrubber bar does not work properly. It is very jerky and you cannot drag it properly. Any ideas why?
I read somewhere that you must close the net connection when you have finished using the player and clear the video object. I have tried to implement this in the flash movie supplied, but it makes no difference. Have I done this correctly and have is there anything else I need to do to get the scurbber bar on the video player working properly each time you view it?
I believe that there is not a lot of information out there on creating your own custom video players and most of the code for the scrubber bar part of it is undocumented e.g. the onMetadata handler.
As I said, I have attached my source files, so you should be able to see what I am trying to achieve if I have not explained it clearly enough.
Any help would be greatly appreciated.
Cheers,
James.
FLV Player Custom Skin Problem
I am trying to use the FLV player to add video to an ad. The problem I am having is I have to upload the main SWF to the ad sever so I have to reference the skin absolutely rather then relatively. The FLV is also referencing a file already on the web.
When I publish the file and view on my computer this works fine but once I upload to any sort of web sever the video never appears. This is definitely a result of the custom skin url b/c when I upload it and put the skin back to default it works fine.
Is there something I might be doing wrong?
Thanks
Best Approach To Dynamic Custom Flv Player
I am currently working on a custom flash player. After working on several working versions where I simply used actionscript to delegate the actions of my custom player.
I am now working on a more dynamic ready flashplayer that will need to be embeddable. Should I make a .swf specificaly for the player using the flash player SkinFLA examples as an outline? The idea is to have a player that embeds like youtube, any suggestions or tutorials to look over? Also, this player needs to have playlist functionality, but it needs to be able to scope to anyone. I could have users register and then create an XML that references their playlist, but it seems like there may be better options. Just looking for some discussion and debate over player best-practices....
ActionScript For Custom Video Player
I deeply apologize for my ignorance in regards to Flash, saying that there is an issue that I'm having and that is, when I bring a embedded video component on to my stage, weather it's a video 8 player or display,for some reason or another, when I go to 'test' my movie, the video isn't showing up. I have pointed to the path and url and I have placed the fla in the same path as the flv, but I get nothing.... Can someone PLEASE give me some guidance and/or direction. WHAT I'm ultimately attempting to do is create somewhat of a video player sort of like the one that's on the front (home) page of ADOBE's webiste. You know, were it reads 6 of 6, meaning the 6th video of video total video and once you click it, that video is played in the player or window.....Thanks so much for the info and knowledge.....
Jaythan
p.s. Also, I need to know if there is a component out there that I can download and pull up in flash in regards to the scrollbars...? I want to add scrollbars to certain areas of the page that contains a lot of text.... The scrollbar that I'm interested in are the modern pill shape ones with the aqua color sort of like the ones ADOBE uses......Text
Custom Multi-Video Player
Hi - I've got a project I'm currently working on that involves 19 flv, e/2minutes long. I successfully followed a tutorial to build a custom window with aFLVPlayback component and a List Box component from which to choose a video. It all works beautifully (locally), switching back & forth between vids. However, when I created a button inside the main application for which this video player was built (click a video icon in the main app. and a small video player window loads in an empty movie clip), I get the window and the name of the first video in the List Box, however, no video or even vid player is visible.
In my main directory, I've got all the files pertaining to the main application; with the video elements in a sep. folder within; all the flvs, the custom skin swf, and the main video .swf.
I cannot figure out how, once I click the video icon to call the video page into the empty mc, to get all the video titles to appear in the List Combo and then of course, show the video on the player.
Is it something with the Data Binding? I've tried looking at the Content Path to see if I can include all the .flv's here, but no dice. Also, I've tried simply putting all the files into one folder rather than having a separate video file and still, same results.
ANY/All help is greatly appreciated! Thanks in advance!
Custom Video Player Class. Help
I wanted to know if anyone had any good resources for creating a custom video player class. Nothing too fancy, just need a nonComponent reusable player and am new to creating custom classes. Any help would be greatly appreciated.
Help Custom Video Player Class
I read through the tutorials for Paul Newmans vid player. I am trying to make a custom video player class with the code below. Since I am new to custom classes, I am having some difficulties. When I use the code below on the timeline, everything works perfectly. The following Class code displays the video and sound. The mute button works. But the play and pause buttons trace out but do not function. Also, the scrub bar and load progress bar dont work.
I have been at this for hours! Any help would be greatly appreciated!!!
=================Timeline Code=======================
/*
var scrubbing:Boolean;
var t:Number; // current playhead time (in seconds)
var totalTime:Number; // length of FLV (in seconds)
var playing:Boolean = false;
var scrubberLength:Number = mcContainer.movieScrubber.clipTimeline._width;
var scrubRange:Number = scrubberLength - mcContainer.movieScrubber.scrubDot._width;
// NetConnection object
var video_nc:NetConnection;
// NetStream object
var video_ns:NetStream
// Sound object
var oSound:Sound;
var soundLevel:Number;
var intID:Number;
// display FLV download progress
function updateProgress():Void{
var bl:Number = video_ns.bytesLoaded;
var bt:Number = video_ns.bytesTotal;
mcContainer.movieScrubber.loadProgress._width = Math.round(bl/bt * mcContainer.movieScrubber.clipTimeline._width);
if(bl > 4 && bt > 4 && bl >= bt){
//trace("FLV loaded");
clearInterval(intID);
intID = null;
}
}
video_onStatus = function(infobject):Void{
for(var i in info){
//trace("onStatus: " + i + " = " + info);
}
if(info.code == "NetStream.Play.Stop"){
// video is over
videoCompleted();
}
}
video_onMetaData = function(infobject):Void{
for(var i in info){
//trace("onMetaData: " + i + " = " + info);
}
totalTime = info.duration;
video_ns.play(video_ns.autoPlay ? false : true);
playing = video_ns.autoPlay;
}
// --------------------------------------------------
// button handlers
// --------------------------------------------------
mcContainer.mcPlay.onRelease = function():Void{
video_ns.pause();
playing = false;
}
mcContainer.mcPause.onRelease = function():Void{
video_ns.pause();
playing = true;
}
mcContainer.mcDownload.onRelease = function():Void {
getURL("videos/test.zip");
trace("download hit");
}
mcContainer.mcCloser.onRelease = function():Void {
trace("closer hit");
}
// --------------------------------------------------
// Video scrubber
// --------------------------------------------------
mcContainer.movieScrubber.scrubDot.onPress = function():Void{
this.startDrag(false, 0, 0, scrubRange, 0);
scrubbing = true;
playing = false;
// mute volume while scrubbing
oSound.setVolume(100);
}
mcContainer.movieScrubber.scrubDot.onRelease = function():Void{
this.stopDrag();
scrubbing = false;
playing = true;
video_ns.pause(false);
// restore volume
setVolume(soundLevel);
}
mcContainer.movieScrubber.onEnterFrame = function():Void{
if(scrubbing){
t = (this.scrubDot._x/scrubberLength) * totalTime;
// this pauses video until scrubber is released
video_ns.pause(true);
video_ns.seek(t);
}
else{
// NetStream.time method returns current playhead time
var scrubFactor:Number = video_ns.time/totalTime;
this.scrubDot._x = scrubRange * scrubFactor;
}
}
// --------------------------------------------------
// Volume controls
// --------------------------------------------------
mcContainer.mcMute.onRelease = function() {
var globalVolume:Sound = new Sound();
globalVolume.setVolume((globalVolume.getVolume()+1 00) % 200);
};
// --------------------------------------------------
// Functions
// --------------------------------------------------
function loadPreferences():Void{
setupVideo();
}
function setupVideo():Void{
// set volume properties
oSound = new Sound(this);
//soundLevel = volume;
setVolume(soundLevel);
// create a NetConnection object that can be used with a
// NetStream object to play back external video (FLV) files
video_nc = new NetConnection();
// open local connection
video_nc.connect(null);
// create a NetStream object to play FLV files
// through the specified NetConnection object
video_ns = new NetStream(video_nc);
// specifies NetStream instance to be displayed within
// the boundaries of the Video object on the Stage
mcContainer.videoPlayer.attachVideo(video_ns);
// start playback of external video (FLV) file
video_ns.play("videos/test.flv");
// update FLV download progress bar
intID = setInterval(updateProgress, 100);
// this is a workaround: define temp value for
// totalTime variable until onMetaData is called
totalTime = 1000;
// set event handlers
video_ns.onStatus = video_onStatus;
video_ns.onMetaData = video_onMetaData;
}
function setVolume(v:Number):Void{
oSound.setVolume(100);
}
function videoCompleted():Void{
// if video has ended, go to beginning
video_ns.seek(0);
video_ns.pause(loop ? false : true);
playing = loop;
}
loadPreferences();*/
============Class Code=====================
import mx.events.EventDispatcher;
class TMNTVideoPlayer extends MovieClip {
private var scrubbing:Boolean;
private var t:Number; // current playhead time (in seconds)
private var totalTime:Number; // length of FLV (in seconds)
private var playing:Boolean = false;
//private var autoPlay:Boolean;
private var movieScrubber:MovieClip;
private var playpauseClip:MovieClip;
private var mcDownload:MovieClip;
private var mcCloser:MovieClip;
private var mcMute:MovieClip;
private var videoPlayer:MovieClip;
private var mcPlay:MovieClip;
private var mcPause:MovieClip;
var scrubberLength:Number;
var scrubRange:Number;
// NetConnection object
private var video_nc:NetConnection;
// NetStream object
private var video_ns:NetStream;
// Sound object
private var oSound:Sound;
private var soundLevel:Number;
private var intID:Number;
private var loadInterval:Number;
public var addEventListener:Function;
public var removeEventListener:Function;
public var dispatchEvent:Function;
//================================================== ============================
function TMNTVideoPlayer() {
//================================================== ============================
EventDispatcher.initialize(this);
setMouseEvents();
setScrubberEvents();
setMute();
setupVideo();
updateProgress();
loadPreferences();
trace("constructor initialized");
};
// display FLV download progress
//================================================== ============================
function updateProgress():Void {
//================================================== ============================
trace("updateProgress");
scrubberLength = this.movieScrubber.clipTimeline._width;
scrubRange = scrubberLength - this.movieScrubber.scrubDot._width;
var bl:Number = video_ns.bytesLoaded;
var bt:Number = video_ns.bytesTotal;
this.movieScrubber.loadProgress._width = Math.round(bl/bt * this.movieScrubber.clipTimeline._width);
if(bl > 4 && bt > 4 && bl >= bt){
trace("FLV loaded");
clearInterval(intID);
intID = null;
}
}
//================================================== ============================
function video_onStatus(infobject):Void {
//================================================== ============================
trace("onstatus");
for(var i in info){
trace("onStatus: " + i + " = " + info);
}
if(info.code == "NetStream.Play.Stop"){
videoCompleted();
}
}
//================================================== ============================
function video_onMetaData(infobject):Void {
//================================================== ============================
trace("onMetaData");
for(var i in info){
trace("onMetaData: " + i + " = " + info);
}
totalTime = info.duration;
this.video_ns.play(this.video_ns.autoPlay ? false : true);
playing = this.video_ns.autoPlay;
}
//================================================== ============================
function setMouseEvents () {
//================================================== ============================
trace("setMouseEvents Working");
this.mcPause.onRelease = function():Void {
video_ns.pause();
playing = false;
trace("pause hit");
}
this.mcPlay.onRelease = function():Void {
video_ns.pause();
playing = true;
trace("play hit");
}
this.mcDownload.onRelease = function():Void {
getURL("videos/test.zip");
trace("download hit");
}
this.mcCloser.onRelease = function():Void {
trace("closer hit");
}
}
//================================================== ============================
function setScrubberEvents() {
//================================================== ============================
trace("Scrubberevents traced");
var scrubberLength:Number = this.movieScrubber.clipTimeline._width;
var scrubRange:Number = scrubberLength - this.movieScrubber.scrubDot._width;
this.movieScrubber.scrubDot.onPress = function():Void{
this.movieScrubber.scrubDot.startDrag(false, 0, 0, scrubRange, 0);
scrubbing = true;
playing = false;
// mute volume while scrubbing
oSound.setVolume(100);
}
this.movieScrubber.scrubDot.onRelease = function():Void{
this.movieScrubber.scrubDot.stopDrag();
scrubbing = false;
playing = true;
this.video_ns.pause(false);
// restore volume
//setVolume(soundLevel);
}
this.movieScrubber.onEnterFrame = function():Void{
if(scrubbing){
t = (this.movieScrubber.scrubDot._x/scrubberLength) * totalTime;
// this pauses video until scrubber is released
this.video_ns.pause(true);
this.video_ns.seek(t);
}
else{
// NetStream.time method returns current playhead time
var scrubFactor:Number = this.video_ns.time/totalTime;
this.movieScrubber.scrubDot._x = scrubRange * scrubFactor;
}
}
}
//================================================== ============================
function setMute() {
//================================================== ============================
this.mcMute.onRelease = function() {
var globalVolume:Sound = new Sound();
globalVolume.setVolume((globalVolume.getVolume()+1 00) % 200);
}
}
//================================================== ============================
function loadPreferences():Void {
//================================================== ============================
setupVideo();
}
//================================================== ============================
function setupVideo():Void {
//================================================== ============================
// set volume properties
oSound = new Sound(this);
//soundLevel = volume;
//setVolume(soundLevel);
// create a NetConnection object that can be used with a
// NetStream object to play back external video (FLV) files
video_nc = new NetConnection();
// open local connection
video_nc.connect(null);
// create a NetStream object to play FLV files
// through the specified NetConnection object
video_ns = new NetStream(video_nc);
// specifies NetStream instance to be displayed within
// the boundaries of the Video object on the Stage
this.videoPlayer.attachVideo(video_ns);
// start playback of external video (FLV) file
video_ns.play("videos/test.flv");
// update FLV download progress bar
//intID = setInterval(updateProgress, 100);
// this is a workaround: define temp value for
// totalTime variable until onMetaData is called
totalTime = 1000;
// set event handlers
video_ns.onStatus = video_onStatus;
video_ns.onMetaData = video_onMetaData;
}
//================================================== ============================
function setVolume(v:Number):Void{
//================================================== ============================
oSound.setVolume(100);
}
//================================================== ============================
function videoCompleted():Void{
//================================================== ============================
// if video has ended, go to beginning
var loop:Boolean;
this.video_ns.seek(0);
video_ns.pause(loop ? false : true);
playing = loop;
}
}
[AS2] Custom (simple) FLV Player: OOP Class Example(s)?
Hi,
Can someone point me to an example of simple, custom, FLV player that uses OOP/class(es)?
I have been learning from many procedural examples... But I really dislike how cluttered the code looks... For learning purposes, I would love to see a good example of a simple progressive OOP/class-driven FLV player... One that uses XML would be totally cool, but I need nothing complex... Just want to see how one would approach scripting a basic FLV player using OOP.
AS3 example would be cool too... but for now, I only have AS2 as a usable option.
Please help!
Many TIA!
Cheers,
Micky
Playing YouTube In A Custom Player
Hi guys. I was thinking about adding some YouTube clips to my site. The problem is that I do not want to have the YouTube branded player on my site. I was thinking about using a custom FLV player; but with the source flv from YouTube.
Do you think this is 'illegal'? Do you know of any other sites who is doing this?
Thanks
Embedding Custom Video/flv Player
Hello,
I run a site where we upload videos directly to our server instead of embedding via youtube, metacafe etc.
I want to take the default looking player we have here: regretfulmorning.com/2008/11/parasailer-perfects-dodo-bird-landing
and customize it, also allowing users to embed it in their blogs, myspace, facebook etc like here:
cracked.com/video_16759_japan-fights-economic-crisis-with-real-life-lolcat.html (sorry cant post links yet)
Does anyone know of a good place to start?
How Do I 'autoRewind' My Custom Built FLV Player?
I've been watching Lee's tutorials on Lynda.com. They're great. Specifically the ones about Flash 8 video playback. I just got finished watching the tutorials on building a custom FLV player.
Here's my question:
How do I get my video to 'autoRewind' once it's done playing?
It doesn't seem to be so simple without the FLVPlayback component :)
Thanks,
--Damon
Where Are The Custom Video Player Tutorials?
I heard this website (gotoandlearn.com) had some great custom video player tutorials, however I'm unable to find them on here. Are they archived or were they removed from the site? :?: If anyone knows where I can find them, please let me know!
Thanks!
Custom FLV Player With Streaming Server
In Lee's tutorial for Flash video at Lynda, he created a custom FLV player using netconnection. This is a great player, but when I try to play a video from my Flash Media Server, the load bar/scrubber doesn?t work. The video plays fine, and all of the controls except for the load bar. It immediately loads tom 100% and if you click on it anywhere the video stops.
Is there something that needs to be done differently when playing for the Flash Media Server with this player?
Thanks.
Add Cuepoint Using Custom Flv Player (not The Component)
Hi people,
I have this custom flv player and now I want to add cue points to it, but I don't
know how. I've been doing research online and I didn't find anything that answers
my question. I know that if I use the component flv playback I can use
addASCuePoint to add cue points in actionscript, but what about custom flv
player? Thanks in advance.
-c
Stable Custom Mouse In Music Player
Hello. I have a quick question. I have been working on a music player.
This player starts on track 1, and automatically goes to track 2, then 3, then 4...all the way to track 10, before going back to track one, thus starting the loop again.
I got help before from the "Sound and Music" Section of the board. They told me I need to put each new movie clip that loads (which are the tracks) into a new level. I did and it worked fine. The Only problem now is the custom mouse cursor I have....
Since the first MC's mouse is positioned at the very top right of the MC, whenever (if I am on track two) I click on anyother track, the mouse, automatically goes back up to the top right even from whatever position it was in before, and I know the problem.... It is because of the levels. When you manually go to another track, the level underneath takes precedence for a little, therefore it goes back the position it was in at the start of the first movie clip, until the next track (movie clip) loads.
I am wondering if there is a way to put a level on the mouse alone..... or a way so that the mouse could be told not to do that? I feel that may be a problem considering that each movie click (10 of them) all have the custom mouse) But is there anyway to stop it from doing that?
Please, any help would be appreciated, and if I didn't make any sence, do tell me, and I'll try to re-word it... Thank you for having read this.
Custom Player Working Great Except Scrubber F8
Everything works great except when I click the loadbar, instead of operating my scrubber script it just stops. Can anyone see a problem with this code? Must be a typo somewhere but I can't find it! Scrubber code at bottom.
//-------NETCONNTCTION SETUP--------------
var nc:NetConnection = new NetConnection();
nc.connect(null);
//-------NETSTREAM SETUP--------------
var ns:NetStream = new NetStream(nc);
ns.onStatus = function(info) {
if(info.code == "NetStream.Play.Start") {
progressBar.onEnterFrame = videoUpdate;
}
if(info.code == "NetStream.Play.Stop") {
delete progressBar.onEnterFrame;
}
}
ns.onMetaData = function(info) {
ns.duration = info.duration;
}
//-------ATTACHING NETSTREAM--------------
video.attachVideo(ns);
//-------PLAYING EXTERNAL FLV--------------
ns.play("curse.flv");
//-------REWIND BUTTON--------------
rewind.onRelease = function() {
ns.seek(0);
}
//-------PLAY PAUSE TOGGLE--------------
playPause.onRollOver = function() {
if(this._currentframe == 1) {
this.gotoAndStop("pauseOver");
}
else {
this.gotoAndStop("playOver");
}
}
playPause.onRollOut = function() {
if(this._currentframe == 10) {
this.gotoAndStop("pause");
}
else {
this.gotoAndStop("play");
}
}
playPause.onRelease = function() {
if(this._currentframe == 10) {
this.gotoAndStop("playOver");
ns.pause(true);
}
else {
this.gotoAndStop("pauseOver");
ns.pause(false);
}
}
//-------LOADBAR--------------
loadbar.onEnterFrame = function() {
this._xscale = (ns.bytesLoaded/ns.bytesTotal)*100;
if(this._xscale == 100) {
delete this.onEnterFrame;
}
}
//-------VIDEO UPDATE--------------
function videoUpdate() {
progressBar._xscale = (ns.time/ns.duration)*100;
}
//-------VIDEO SCRUBBER--------------
loadbar.onPress = function() {
progressBar.onEnterFrame = videoScrub;
}
loadbar.onRelease = loadbar.onReleaseOutside = function() {
progressBar.onEnterFrame = videoUpdate;
}
function videoScrub() {
var dist:Number = (_root._xmouse-loadbar._x)/loadbar._width;
ns.seek(Math.floor(ns.duration*dist));
progressBar._xscale = (ns.time/ns.duration)*100;
}
Using CuePoints In Flash Video- Custom Player
I've successfully created a custom player using the Video (not the player component.) I have embedded an Event cuePoint while encoding to FLV. All I want to do (and maybe there's an easier way?) is to return the viewer to my "Home" frame on the main timeline when the FLV ends (where the cuePoint is.) This is what I've used before to accomplish this with the Player Component. But it isn't working with my custom player. I've tried putting the AS into the AS of the player, on its on layer and on it its own layer on the main timeline. No luck.
Any help?
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
var cuePtName = eventObject.info.name;
if (cuePtName == "end") {
this._parent.gotoAndStop("home");
}
};
video.addEventListener("cuePoint",listenerObject);
Custom Skin Not Working In Video Player
Hi
I wanted to change the default behavior of the Flash Video Player skin such that "caption" Button works as a link and opens a new browser window.
I took SkinOverAll.fla saved as SkinOverAllCustom.fla and added following code:
this.captionToggle_mc.addEventListener(MouseEvent. CLICK, onCaptionClick);
function onCaptionClick (e:MouseEvent):void
{
trace("caption button clicked!");
var url:String = "http://www.google.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_blank'); // second argument is target
} catch (e:Error) {
trace("Error occurred!");
}
}
When I test this clip as SkinOverAllCustom.swf , the caption button click opens a new browser with google.com.
But now when I add this skin in my FLVPlayback component it doesnt work, code is added as:
player.skin = "SkinOverAllCustom.swf";
player.skinBackgroundColor = 0x5E5E5E;
player.skinBackgroundAlpha = 0.85;
captioning.flvPlayback = player;
player being the instance of FLVPlayback and captioning being instance of FLVPlaybackCaptioning
Can anybody suggest what changes should I make so that caption button works as a button and I can control its onclick event?
Thanks
Custom Video Player - Share Link
I'm using Flash 8 Pro - AS2.
I have a custom video player I've created, I'd like to add a "share" function to it so that when someone clicks on the button they can type in their name, email, their friends name & email and then send a link - and it will basically send a link to the page they are on.
Could someone help me out with this?
FOO
|