ActionScript 3.0 :: Api - AttachNetStream In Video Class
Oct 2, 2008
I'm using Adobe Flex Builder 3 with Flex 3.1 SDK. There is a sample code in documentation to play flv files, however I have compilation errors when I try to use it. Basically it says that there is no such method NetStream.play("file.flv") which takes string argument. There is one without arguments. Plus, It could find method attachNetStream in Video class. I'm confused, what I'm doing wrong!?
I pose this question to you. I have created a video player that functions off of the Video Class, netConnection and NetStream and up until this very moment works 100% as it should.The hang up I'm getting is that I have a onMetaData function that checks ALL of the flv's or f4v's metadata as it is loaded into the player, so i can use it to control some other elements of the player. Here is the code I am using:
Code: my_ns.onMetaData = function (md:Object) { for (propName:String in md){;
I am trying to put together a class for playing video using the Video object. So far, I have only been successful in getting the Video object to fully work when not using a class setup. In the documentation, I have read that to use the Video object you have to actually drag/create the video object onto the stage. So, in my next attempt, I created the video object onto the stage within a MovieClip but still trying to use a class/linkage setup with the Video inside inside of a MovieClip container. No luck there either. Here is the basic AS2 script that is linked to a MovieClip that contains the Video object ("video" instance) within it.
Code: class VideoTest { private var nc:NetConnection; private var ns:NetStream;
[code].....
I am getting the following error with this script.
Code: Line 14: There is no property with the name 'video'. Line 15: There is no method with the name 'video'.
I've got a document class (EgoGame.as) and another class (Ball.as) which has been duplicated to deal with several different video pieces. Inside the document class is a list of 'if' statements which decide which video should be played. At the moment I'm doing it the old fashioned way whereby if the condition is true....it tells the relevant Ball class to gotoAndPlay a certain frame within the linked movieclip...
i've made my own video player class, which uses the flash's natural video class (flash.media.Video) and the netStream and netConnection class. all works fine when i test it from a server (not locally) using IE 8, untill i refresh the page i get the following error:
I have been trying to put the As3 video tutorial into a class which works fine if I keep the url of the file to play within the class. But I want to be able pass the url from the actual swf file... I have had limited success.
When I try and use the video class in as3, I get this error:
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetStream was unable to invoke callback onMetaData. error=ReferenceError: Error #1069: Property onMetaData not found on flash.net.NetStream and there is no default value.
I have implimented a video handler class to part of my project. What it is intended to do is remove the playing video using the netStream method and create a new instance with a new video file.I can remove it using a standard removeChild function. However the pain occcurs when I can still hear the audio palying.I guess my issue is that this is handled in a class and every time I create a new video it creates a new instance of the class.My question is then how do I call netStram.close() from another class before creating a new video instance.[code]
I am trying to load video using NetStream. I am able to do this by using the Video Class, but is it possible with the FLV Playback? I would like to add a seek bar so people can scroll the video if they want to.
I know the FLV Playback Component has this built in so I would use it BUT I can't load a stream to the FLV Playback, I can only set it's source. This works fine, but it doesn't allow me to unload it, the sound keeps playing, which is why I ended up using the NetStream instead.
So I have 2 questions. 1) Is it possible to load the NetStream to the FLV Playback component? 2) If not, how do I add the seek functionality to my Video Class?
I have a buttons class that puts 9 pictures on the stage and each one represents a different movie and leads to that movie when clicked (or will lead there once I figure out how to reference it to the specific movie). I have 9 movies referenced through XML. And I am using flvPlayer. Currently I can only have one movie loading. I am not sure how to get each one to play upon click of the respective btn.
Here is some of the code I think is pertinent if figuring how to go about this: ProjectOneButtons class //I have each picture loaded through an array and each button is waiting for the right code through a Switch statement: public function onButtonClick(e:MouseEvent):void { var releventImageAray:Array = this["rowOfImages" + MovieClip(e.currentTarget).row]; var imageWanted:String = relaventImageArray[MovieClip(e.currentTarget).column]; switch (imageWanted) { case "Video1" : [Code] .....
The reason I included a bunch of code is to show that there is a play/pause button that is supposed to play the movie. But the thing is I only have the one movie referenced and I am not sure how to have it variable as to which movie is played and make it depend on the button that is clicked from the button class above. All of this code works as it is and I am getting no errors.
How do I maintain aspect ratio using the Video Class object "<media:Video id="video" />", not the VideoDisplay or FLVPlayback objects. I am using the Video Class object, Netstream and NetConnector, using LifeSize as my server, protocol is RTMP and the url is like: [URL]
Everything plays back fine and for the most part my code is like this:
I have an application, implemented using the Flash Video class. How do I make it run a .flv video in full resolution? All videos are running in the default 320x240 resolution.
i am creating a package, MainTimeLine.as, to extend my main timeline. i use the FLVPlayback component under the package. however, i get the compile error:
1172: Definition fl.video:FLVPlayback could not be found. so i added the "import fl.video.FLVPlayback;" line to my MainTimeLine.as file, but flash gives the above error. now i had this problem when i added this code directly under a frame of the main timeline until i added a FLVPlayback instance to my library. now, i am trying to simply embed all of the code under the MainTimeLine.as file and have the as file encapsulate all of it. but, i still get that error.
so, how do i get flash cs4 to recognize and use the import properly
I'm trying to use the NetConnection class to connect to a live video feed on an external server. I have it set up to start playing my video when the user clicks a Play button, however, this appears in my output every time I click the Play button:
ArgumentError: Error #2126: NetConnection object must be connected. at flash.net::NetStream/ctor() at flash.net::NetStream() at Over/connectLiveStream()[Over::frame2:31]
Here is the (I think relevant) code: if (playVid.label == "Play") { nc = new NetConnection(); nc.objectEncoding = flash.net.ObjectEncoding.AMF0; nc.connect("rtmp://my.rtmp.server:1935/live/"); nsPlay = new NetStream(nc); nsPlay.play("livestream.flv"); }
Is it possible to use the FLVPlayback class to play an instance of the Video class? I'm loading the video (which is just an audio track with cue points) in using GreenSocks LoaderMax (along with the rest of my assets) and so have various instances of Video. The FLVPlayback class only accepts a String as its' source. Is there any way to hack it to bypass whatever loading it does and just feed it the video directly?
I'm building a video chat in flash and everything works really well, except for the part where I'm trying to detect if the other user is sending a working video stream. There's a couple of reasons why the other user isn't sending video. -The other user got no camera -The other user got a camera, but the camera is currently being occupied by another application(Skype, Photo Booth, Google Talk, etc.) -The other user got a camera but hasn't allowed the use of his/hers camera. (Other unexpected problems I guess...)
So how do I detect if the stream I receive from the other user is a black stream(because of the reasons above) using the NetStream class? The closest thing I have came up with is by adding a timer that polls the currentFps() function from the stream I receive from the other user. But so far this seems pretty unreliable because I might get currentFps() == 0 and show an error because of this even though I actually got video from the stream in some cases. The reason for this is because I poll the API every 4 seconds for the currentFPS function and let's say at 00:00:04 I get "no video" according to the poll but at 00:00:05 the video kicks in, and therefor I need to wait until the next tick until the error message disappears
This is what my current poll looks like function subscribingStatusPoll(e:TimerEvent):void { if (subscribingStream.currentFPS == 0){ error.text = "No video found from the other user... } else { error.text = ""; }}
This is the only hack I that I can come up with to detect this, but this is unreliable and I actually would prefer a way to instantly detect if the stream I receive got a working video attached to it.
I just made a class that fits a video to the fullscreen of the browser. I need some input on functionality of the class. What would you like to see added to the class. Though keep in mind that this is meant to be a backdrop to a site and not a video player. Link to class. [URL]
just implemented the 3D Video Flip in one of my projects and I would like to add a dynamic reflection to it. I tried using the pixelfumes class to no avail. It seems like the fact that there is a button in the mc is messing it up. The pixelfumes class is pretty close to being what I want. It just seems to create a reflection way out of range.
Ive start to use the new FileReference class (FP 10) and I create a local image viewer with a loader and bitmap. But now I want to take it one step further and make a local FLV Player. I need a SWF file, so for that reason Im not using AIR.What class should I use to play the video? This is part of the code I use for the image viewer.
I am on a quest to get this Class stuff down. I watched the video for As2 Class. how that is written for As3? I just need the Random number part. My program needs to be able to say Math2.MyRandomNumber(1,50). Am I thinking about this correctly? and then a Math2 class will spit it out?
I am creating a custom video class and was wondering is anyone knows how to turn cue points embedded in an flv into a time in an array.
I have tried the following but, although it doesn't give me any errors, it simply rewinds 1 second rather than skipping back to the correct cuePoint. I can't figure out why? :
Code: public var _durationArray:Array = new Array(); public function makeArray(info:Object):void { for (var i:Number = 0; i < info.cuePoints.length; i++) {
[Code].....
This previous code is amongst other code, which makes does things. Then in a new class I call it inside a function (which triggers fine):
When opening a fla - made in cs5 - in flash cs 5.5 a message asks if I agree that the file will be converted to cs5.5. I agreed to the conversion and saved the file.When opening this "converted" fla I get an output error message: #1014: class fl.video::UIManager could not be found.The file is 08End.fla from Classroom in a Book Lesson 8.
I am trying to work with the EventDispatcher class to dispatch a custom event to stop a video from playing. The video plays inside a MovieClip with an attached class file called PlayerProfile. I want the video in the PlayerProfile MovieClip to stop playing when the user clicks on another MovieClip called ScrollBox. I'm getting no compile or runtime erros, but the code is not stopping the video. I have seen use of a public static constant to represent the custom event. Is that what I am missing here.
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..