ActionScript 3.0 :: OnMetaData Video Progress Bar?
Apr 2, 2010
I've been following a couple of tutorials on making a custom video player and they all use the onMetaData event of the NetStream class to get the duration of the video. I always get this error though ns.onMetaData = function(obj:Object){1119: Access of possibly undefined property onMetaData through a reference with static type flash.net:NetStream.Here's what I have, sorry about the commented stuff I've been trying different things:
Im just a few week into AS and scripting in general so Im not sure why what I've got is working.
I want to create a scaling video that is full screen - from scratch. I later want to dynamically load a graphic and tile it over the video - I've done that here
I was at the point that the video I was loading would only resize to the stage when the stage Event.RESIZE fired. I need the video scaled when it loads - so my approach was to try and do something with the onMetaData height and width values. I was going to create a function which returned the proportionally scaled native values back to Video(). However I'm not savvy enough to know how to get those values back into the playVideo function.
Along the way I stumbled on something that seems to work - but I dont really undersand why! - or if its 'best practice'.
I trying to set up my video progress bar so it shows the video streaming in. Currently it only shows the video progress. If I pause the video using my pause button, the progress bar pauses to.
ActionScript Code: import caurina.transitions.Tweener; var fv:String=root.loaderInfo.parameters.vars;
Get away from using flashs skin and use my own play and stop buttons progress bar.Be able to use an autoplay within the script and not use the parameters autoplay. using which is working fine. I just want to be able to have more control by being able to write code for the above activities.
Almost every flash player has an option to display how much of buffer (or % of total video) is downloaded to the client. At the moment I don't see it in any implementation of html5 video player.
The real problem I am trying to solve is to have a way of knowing % of downloaded asset (image/swf/video whatever). In flash its easy by using MovieClipLoader and bytesLoaded property.
Is there any way of doing it in HTML/HTML5/Javascript (without relying on Flash) ?
On my stage I have a mc (videoLoader) with the mc (loadBar) inside it. When I preview the movie it shrinks loadBar to where it should, but it doesn't expand as the video loads.
ActionScript Code: this.addEventListener(Event.ENTER_FRAME, loading); function loading(e:Event):void[code].........
I am having an issue with tracking the progress of a URLRequest for a FLV file. My code is as follows:
ActionScript Code: var backgroundVideoSourceRequest1:URLRequest = new URLRequest("video/loops/Loop1-1080.flv"); var backgroundVideoSourceLoader1:URLLoader = new URLLoader(backgroundVideoSourceRequest1); backgroundVideoSourceLoader1.addEventListener(Event.COMPLETE, changeVid1Status); backgroundVideoSourceLoader1.addEventListener(ProgressEvent.PROGRESS, video1status);
I'm building a flv_video AS3 player. I'm using steaming-video.The player is working fine, but there is something that I want to improve. Currently when I push play button and if I drag&drop the scrubber of progress-bar somewhere in the area that is still not buffered, the player doesn't start to play from that position. So I want to do it.
I am trying to dynamically resize an flv playing back in a flash player. To do this, I need to get the flv's width/height so I can maintain the original aspect ratio. I have noticed that in Firefox the onMetaData event will be hit right away, and the video will resize properly. In IE however, onMetaData is not hit until the buffer is full and video starts playing.
One solution I have thought of is to set the initial buffer to something close to 0 (e.g. 0.01). Then the buffer will instantly hit full, and the video will be resized. The issue I have with this is low bandwidth users will have a a short 'sputter' of video (0.5 seconds say) at the beginning before it goes to the next, larger, buffer. Is there any better way to deal with this behavior in IE? Can you manually "get" the metaData from an FLV file before it even plays?
I'm puling in a FLV via a NetConnection (NetStream), and I've got it all working well EXCEPT for the scrubber. Here's the code I'm using for the scrubber[code]...
I'm puling in a FLV via a NetConnection (NetStream), and I've got it all working well EXCEPT for the scrubber. Here's the code I'm using for the scrubber:
**** //Scrubber var videoInterval = setInterval(videoStatus,100); var amountLoaded:Number;[code]....
I have an SWF movie (1375 frames) and created a progress bar (248px wide) with a slider that moves according to the movie progress. I'm doing that next way:Calculating the distance for the slider to be moved each frame (248 / 1375) On each ENTER_FRAME moving the slider for the calculated distance The problem is - the movie ends far before the slider reaches the end of the progress bar.
I'm thinking that the distance (Step 1) is is somehow ends floored by Flash and the actual distance it moves the slider is smaller than required. That's why the movie ends, but the timeline control just passed the 2/3 of its way. My question is - is there any solution for the problem? Or any other way to go, if it's a wrong one?
I have a class set up that should just spit back the duration of a loaded video file. It works, but my onMetaData handler seems to get triggered twice, even though I can only see one place that should trigger it:
Code: public function PENetConnection (obj:Object=null) {
Currently we have updated to FMS4.5 and doing some evaluation on HDS. We published our RTMP streams to the livepkgr application and successfully setup and playback HDS. However, we found that a we can't access some onMetaData Properties during playback. Our player use onMetaData - "videodatarate" and "audiodatarate" properties. We are trying to migrate it to playback HDS, however, we don't seems to be able to get back the two fields?
I am using NetStream to play some .flv files on local disc. My code skeleton is:
public class AdvertisPanel extends MovieClip { private var _video:Video; private var _connection:NetConnection;
[Code].....
I used some .flv files that I download from YouTube to test; and I found that the handler metaDataListener would not be called when playing some .flv files, but some would. Is the problem caused by the video file? Because I may resize the video before play it on the screen, and I really need to know its original width & height.
i'm using FLVPlayback in order to load a movie. i keep getting this error: Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetStream was unable to invoke callback onMetaData. error=ReferenceError: Error #1069: Property duration not found on Number and there is no default value.
if i get it right, it means that inside built-in onMetaData there is no duration property. so, i tried adding my own call back function:
//creating a custom client var customClient:Object = new Object(); customClient.onCuePoint = cuePointHandler;
I rarely use NetStream or any video in my projects, but someone I email with was wondering this, and I have no earthly idea.
Is there any reason why the NetStream's "onMetaData" event cannot be listened to using addEventListener, but instead requires you to use a callback function?
Is it faster, avoiding the overhead of events? Is it to prevent more than one listener being attached?
Recently i have visited so many video enriched flash site like this one [URL] Most of them shows video in full size. I downloaded the video using FF plugin. Video framesize is very small compared to the stage size. When i tried to add video and resize the video acoording to the page size , it slows the browser. I tried to embed the flv inside an swf and loaded the swf using normal loader and plyed it.. but the quallity and performance comapred to these site is very low..
I made a video in After Effect and export it to flash as a FLV video.. and write de code to load it into flash.. but I need it to loop.. Here is the code
I have created a progress bar using AS2 before but I only vaggly remember how I know that it involes using some code that deals with percentages but other then that I don't remember how to do it and I really don't remember how to apply it to my my .swf. and have it appear in my HTML page.My flash file was created using AS2 in Flash CS3
I've been having a hard time for some days now trying to make a progressbar in AC3. I searched the web and tried several different approaches and attempts but nothing works. I hope I can get some input from here now...
The main portion of the applicataion is working. It's only when I try to use AC3 to control the jumps in the timeline the problem occours.
As I run the code all the trace-statements is printed. But the bytes is 0 all the time. I guess this has something to do with the main problem. I tried to simulate the download-process, but in this way not even the "kirupatxt.text = "TESTING";" is printed in my dynamic textfield.
I've created a progress bar animation to load an external SWF file as described in this document: [URL] The problem is, the SWF file i want to load is a magazine exported from Indesign, so I want it to display one page (frame) at a time (you can go to the next page using the navigation buttons provided). When I use the method mentioned above the clip loads, but then it plays... so how can i make it stop at the first frame?
I need to add a progress bar/playback controls for a presentation built in AS 2.0 which has such length voice over in it we've decided we need to give the user the ability to see where they are in the timeline and scrub through sections of the presentation. I'm familiar with stop and pause button code in situations like this, but it's the first time I've needed this kind of functionality. Presently, the first part of my project is set up with several scenes and is completely linear. The second section is interactive with swfs loaded into empty movieclips.
I've found a number of references to progress bars online, but they're all for loading content, not for navigating once content is downloaded.
I am trying to make a progress bar to show the my application loading status. I google a lot but it only shows how to use progress bar for elements (ex: images, datagrid). I need to know the progress bar setup for the entire application.