AS2 to AS3 Streaming Video Player
Ok so Im trying to convert a video play that i made in AS2 to
AS3 (I had a problem with nested movie clips and the control bar
and i want to learn AS3) and i am having troblem even connecting to
my rtmp server. With the player i made in AS2 i was able to connect
and stream video no problem. But with AS3 I am not even able to
connect to the rtmp server. Here is the AS2 code and the AS3 code:
AS3:
var video:Video = new Video(853,480);
addChild(video);
var nc:NetConnection = new NetConnection();
nc.connect("rtmp://[ip of server]/sumone4life/videos");
var ns:NetStream = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS,
onStatusEvent);
function onStatusEvent(stat:Object):void
trace(stat.info.code);
var meta:Object = new Object();
meta.onMetaData = function(meta:Object)
trace(meta.duration);
video.attachNetStream(ns);
ns.play("AdobeBand_640");
And I get the error:
ArgumentError: Error #2126: NetConnection object must be
connected.
at flash.net::NetStream/construct()
at flash.net::NetStream()
at videoPlayer_fla::MainTimeline/frame1()
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095:
flash.net.NetConnection was unable to invoke callback onBWDone.
error=ReferenceError: Error #1069: Property onBWDone not found on
flash.net.NetConnection and there is no default value.
at videoPlayer_fla::MainTimeline/frame1()
Flash media server 3 Administrative Panel also shows that I
am infact connected to the server but there is nothing being
streamed from the server.
AS2 Works:
//Video Loading Controls
var fileName:String = "AdobeBand_640";
var nc:NetConnection = new NetConnection();
var ns:NetStream;
nc.onStatus = function(info){
trace(info.code);
if(info.code == "NetConnection.Connect.Success"){
playVideo();
function playVideo(){
ns = new NetStream(nc);
ns.onMetaData = onMetaDataHandler;
videoObject.attachVideo(ns);
_root.createEmptyMovieClip("vSound",
_root.getNextHighestDepth());
vSound.attachAudio(ns);
ns.setBufferTime(5);
ns.onStatus = function(info){
trace(info.code);
if(info.code == "NetStream.Buffer.Full"){
bufferClip._visible = false;
if(info.code == "NetStream.Buffer.Empty"){
bufferClip._visible = true;
if(info.code == "NetStream.Play.Stop"){
ns.seek(0);
ns.play(filename);
//connects the stream
nc.connect("rtmp://[ip of server]/sumone4life/videos");
Can anyone offer any insite as to why it would be workin in
AS2 and not in AS3? Or what i am doing wrong...
I have a similar problem. Did you get your to work?
Similar Messages
-
Creating a streaming Video Player w/bandwidth detection... HELP!
Hi everyone,
I've just been asked to create a video player which automatically chooses the correct bitrate video to stream by detecting the bandwidth.
I have no experience creating a video player so I'm looking for links/resources to do some research on the topic.
Has anyone here created a video player in Flex? Would it be better to create in Flash or Flex?
Once again, I have no prior knowledge in this type of creation and could use an experienced developer's opinion on what the first step is towards progress.
ANY information on this is greatly appreciated.
Kind regards,
DeyYour best options are to use a streaming server connection. There are numerous companies that can host it for you, or you can buy a license and install it on your existing web servers. But to accomplish this task, you will want to look into what is called Dynamic streaming. Some great tutorials that will get you started are here: http://www.adobe.com/devnet/flashmediaserver/articles/dynstream_on_demand.html and http://www.adobe.com/devnet/flashmediaserver/articles/beginner_dynstream_fms.html
Take a look through those, they should show you that it is fairly simple to accomplish.
Good Luck! -
What do I do to make Quick Time the streaming video player?
I want Quicktime to be the streeaming video player, but Windowz Media Player keeps taking over.
What do I do to correct this?
Thanks,
KeyWSorry but the confusion will just get deeper.
The Web page authors actually have control of what browser plug-in is used. If they write code for Real Player that is what you'll need to use. The same for QuickTime formats even though Real Player can handle most of them.
You can can set the "MIME Types" for the QuickTime browser plug-in and that could release more file formats.
QuickTime Control Panel / Advanced tab MIME Settings button.
Maybe if you posted a few URL's that are giving you trouble we could help with solutions or answers. -
Leopard and ABC streaming video player incompatibility?
Since installing Leopard (clean install) on an iMac G5, the quality of video streaming from ABC has deteriorated -- it is now stops and stalls. Does anyone know if there is some incompatibility between Leopard and the ABC episode player? Or are there some settings I can change to fix this problem.
This is not Internet congestion as I have tried it at all times of the day, and also the ABC episode player works well in Tiger (running on my other G5).I've had decent luck with MLB.TV with the following work around. I just remove the Windows Media Plug-in from the /Library/Internet Plug-Ins. Then when you try to watch (or listen to) a game, you get a message saying that Safari isn't supported, but you do get the option to "Proceed". After hitting "Proceed" the page starts to load and then you get the message saying something along the lines of "Safari can't display the content, would you like Windows Media Player to try. Click OK and the stand-alone Windows Media Player should open the stream. And from the app, you can resize the window. A bit clunky, and it probably won't allow for the soon to be released Multi-game Mosaic option, but it works - even on a 3 year old iMac
iMac -
Hi.
Below I have a bit of code that determines the bandwidth that a user has. It is written in ActionScript 2. The problem is that I am unfamiliar with AS2, and I wanted to use this in conjunction with a live streaming video player built in AS3. I was wondering if anyone could give me the equivalent code in AS3, or if there's any way to tell flash that a portion of the code will be written in AS2.
Thank You,
Ari Amiri
nc = new NetConnection();
nc.onStatus = function(info) {
trace("Level: "+info.level+" Code: "+info.code);
if (info.code == "NetConnection.Connect.Success") {
trace("--- connected to: " + this.uri);
nc.onBWDone = function(kbitDown, deltaDown, deltaTime, latency) {
trace("onBWDone: kbitDown:"+kbitDown+" deltaDown:"+deltaDown+" deltaTime:"+deltaTime+" latency:"+latency);
// app logic based on the bandwidth detected follows here
detected_bw = kbitDown;
// close the Netconnection to bwcheck
this.close();
nc.onBWCheck = function() {
trace("onBWCheck");
return ++counter; // Serverside, just ignore any return value, For now return the call count
nc.connect("rtmp://216.18.231.42/bwcheck", true);
stop();Thanks kglad. However, my preloader doesn't seem to work
quite properly. The graphic that I want to fill up as the movie
loads does not appear for a while, then suddenly fills up and just
sits there for a while until the movie is displayed. Do you know
why this might be? -
Hi.
Below I have a bit of code that determines the bandwidth that a user has. It is written in ActionScript 2. The problem is that I am unfamiliar with AS2, and I wanted to use this in conjunction with a live streaming video player built in AS3. I was wondering if anyone could give me the equivalent code in AS3, or if there's any way to tell flash that a portion of the code will be written in AS2.
Thank You,
Ari Amiri
nc = new NetConnection();
nc.onStatus = function(info) {
trace("Level: "+info.level+" Code: "+info.code);
if (info.code == "NetConnection.Connect.Success") {
trace("--- connected to: " + this.uri);
nc.onBWDone = function(kbitDown, deltaDown, deltaTime, latency) {
trace("onBWDone: kbitDown:"+kbitDown+" deltaDown:"+deltaDown+" deltaTime:"+deltaTime+" latency:"+latency);
// app logic based on the bandwidth detected follows here
detected_bw = kbitDown;
// close the Netconnection to bwcheck
this.close();
nc.onBWCheck = function() {
trace("onBWCheck");
return ++counter; // Serverside, just ignore any return value, For now return the call count
nc.connect("rtmp://localhost/bwcheck", true);
stop();Yah very important point from NetDragon. As of version 3.0
the netconnection " class was dynamic in ActionScript 2.0 but is
now sealed. " so you can't just do something like:
netconnection.client.somefunction = function() {...}
The default netconnection.client = this, so you need to
extend it with a custom class or an object to be able to add
callback functions
But be careful, I wrote an entire app that worked with the
AS2.0 technique ...without an error from the compiler.....(flex
2.0). -
E2500 - Not connecting to the video player.
Got it home and tried to connect it to my streaming video player in the next room and it would not connect at all. I took it back and bought a different brand and it connected immediately and stayed connected for 6 hours of streaming video with zero drop outs. It stays connected and my streaming video player does not have to search for the router each time I want to use it.
What's great about it: nothing
What's not so great: poor connection
This product has...
Unreliable connection
Dual band
Short range
slow connection
About me...
Heavy media streamer
Technology guru
No, I would not recommend this to a friend.
I use it in...:Small homeThere might be some settings required in the router so that it gets the proper solution. If you are facing the concern of getting lag, dropped connections then you can try the following steps:
A] With the help of Cisco Connect Software (if at all you have installed the router with the help of this software)
1] Open the software and go to the option which says "Router Settings"
2] Then click on the option which says "Advanced Settings" which will take you to the router's configuration page.
3] Then go to the Wireless tab, keep network mode as mixed,
For Channel Settings of 2.4 GHz you can make Channel Width to 20 MHz only and Channel to 6, 9, 11..
For Channel Settings of 5 GHz you can make Channel Width to 20 MHz only and Channel to 40 or 161...
B] If you haven't installed Cisco Connect then you can log on to the router's user interface using it's default IP address in the browser which is 192.168.1.1 and type in 'admin' as the password leaving the username field blank. This will take you to the router's web interface and then follow steps as mentioned above to make the changes.
Secondly avoid using any other wireless devices like cordless phones, microwave oven etc nearer to the router. Update the drivers for the wireless card of the wireless computer. Then check the wireless connection status. -
Video Player Error when "scrubbing" ahead of available content
Hi there, hopefully someone can help me work out this problem
I've been having for the past two days!!
I have a built my own AS3 Flash video player and the
'scrubber' bar appears to be causing an error message when dragged
too far ahead (I assume because it's dragging ahead to a part of
the video which has yet to fully load). This problem doesn't happen
when debugging the movie in Flash but does appear when loaded into
a HTML page.
The error message I'm getting is....
quote:
Error #2044: Unhandled NetStatusEvent:. level=error,
code=NetStream.Seek.InvalidTime
at VPlayer()
My VPlayer Class (which creates the video player) code is as
follows....
NOTE: to find the scrubbing code look for the comment "//
Handle the scrubbing through the video playback" and you'll see
that I've attempted to wrap the scrubbing code in a Try/Catch
statement (which doesn't seem to work as it doesn't catch any
errors so you can remove that Try/Catch statement if you feel it's
not needed)
Any help is greatly appreciated as I'm banging my head on the
desk trying to work out how to fix it. I'm relatively new to AS3 so
this may (hopefully) be an easy fix
Kind regards,
M.Thank you!! :)
Your reply helped solve the problem.
I was adding the event listener to the wrong element. I was
originally adding it to the NetConnection....
e.g.
connection.addEventListener(NetStatusEvent.NET_STATUS,
netStatusHandler);
....but I was supposed to be adding it to the NetStream....
i.e.
_stream.addEventListener(NetStatusEvent.NET_STATUS,
netStatusHandler);
Thank you!
Kind regards,
M. -
Hi,
Pls help me to fix an issue with my playbook browser. The embedded flash player is not working... Unable to play the streaming videos... Browser is hanging many times. Restart done, cleared history etc.. Still doesn't work.
Any help would be appreciated.
Thanks.
Solved!
Go to Solution.Hello ak_kanan,
Welcome to the forums.
Try doing the following. In the browser swipe down from the top and choose Settings, now choose Content, here where it says Enable Flash change this to Off. Now try going to the website that was not working (it will not work again this is fine) Once on the page swipe down from the top again and this time enable the Flash setting. Now reload the page and test to see if you have the same issue.
Let us know how you make out.
-SR
Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)! -
How to connect flash video player(like youtube) to live streaming video the programm like
How to connect flash video player(like youtube) to live
streaming video the programm like webcamXP?
Or through a browser to look in a videoplayer video from
other usual personal computer with the program for a video
broadcasting from the web chamber.you can use google to search for tutorials on skinning the component.
-
As2 and As3 on same Flash Player
If i set AS2 codes to play in Flash Player 9, is it possible
that this swf can load an As3 swf at the same Flash Player using
As2 codes???
These swfs both play in same virtual machine which is player
version 9 but the other is coded with As2 and the other is coded
with As3. How can an AS2 load a swf coded in AS3 on same Flash
player?
Is this possible?
If yes, how? if no, why not?AS2 and AS3 swfs cannot exist in the same Flash Player
virtual machine - each Flash Player instance (version 9 and
greater) create different address spaces/virtual machines because
the requirements of AS3 and AS2 are so different. -
Flash Player streaming video keeps freezing while audio continues
Hi,
I have been having a problem with flash player for a couple of months now. When watching streaming video's the video will freeze for a second every 5-10 seconds constantly, but the audio continues uninterrupted. I have tried everything, enabling/disabling hardware acceleration; reinstalling flash player 11; trying flash player 10; updating the graphics drivers. I have also tried it on 5 different browsers: IE, Firefox, Chrome, Seamonkey (mozilla browser), and Opera. The same problem occurs on all of them. Yesterday I thought I had cracked it when I realised I had several versions of java installed and once I deleted all the old versions flash player worked fine. However, today the problem has started all over again, and for some reason flash player had deleted itself when I turned the computer on this evening.
I have checked my internet connection speed online and am running an average speed of 5Mbps. I have 2.5 GB's of RAM, and a 2.2 GHz AMD Athlon 64 3500+ processor. I am using Windows XP. I have never had any problems with flash player on this pc (which I've had for 6 years), and as far as I can tell this problem started occurring a couple of weeks before flash player 11 was released.
I'd be very grateful for any help anyone can give resolving this problem.
Regards,
Chris PerkinsChrisP500 wrote:
I think the issue may be related to Silverlight which I think was released in September when we both started getting this problem. DIsabling it does not work, so I'm still not sure how or if it really is causing this problem.
If the player is Silverlight, you'd be able to see that by right clicking the video.
Can you go to Youtube, play any video and then right click it and choose "Take Speed Test". That will take you to a graph where you can see what your download speed is in relation to your ISP, your location and other data. If the black bar is way down compared with others, then I would suspect that something, or somebody else is using your bandwidth. Do you have wireless? If so, change the security code. It may be being used as a wireless hotspot by your neighbours.
You can also play the test video which will show data usage in real time. -
Received upgrade notification for Mozilla to 3.6.15 which we undertook. The computer after completing this activity now cannot stream video through our proxy provider from BBC I-player, even though we have ensured we have the latest Flash Plug-in. The system was working perfectly prior to this event. Even if we delete and re-download the update, the file loads and then when asked to run, "File Corrupt message appears. Please advise or provide solution if possible. Thanks
Received upgrade notification for Mozilla to 3.6.15 which we undertook. The computer after completing this activity now cannot stream video through our proxy provider from BBC I-player, even though we have ensured we have the latest Flash Plug-in. The system was working perfectly prior to this event. Even if we delete and re-download the update, the file loads and then when asked to run, "File Corrupt message appears. Please advise or provide solution if possible. Thanks
-
How to download video player stream for ipad?
How to download video player stream for ipad for free?
Most such tutorials that I've seen are done as self-contained apps. For instance, the ones from this company:
http://itunes.apple.com/us/artist/appdesigner.com-inc./id361068165
All such apps are delivered via the iTunes Store, which binds an app to the purchaser's iTunes Store account so the app can't be shared with anyone else. You can learn more about developing and selling apps for iOS here:
https://developer.apple.com/programs/ios/
Regards. -
Flash player controls (for live streaming video) frozen...
Hello,
Lion, Flash Player, and CNN's live-video player are not playing together nicely on our 2010 MBP 13". In fact, they're not playing.
Have tried the latest suggested fix, which is to right click on the errant video stream, then disable hardware acceleration. Unfortunately, right clicking brings up a "frozen" settings box. None of the buttons can be clicked, not even cancel.
Have accessed Flash Player through the Control Panel, but there is no switch there for hardware acceleration.
Bottom line, am now unable to view live video content from CNN and others.
Have tried uninstalling and reinstalling Flash. Have tried Safari, Firefox and Chrome. And am not a step closer to a solution. Was hopeful that today's install of Lion would set things right, but alas...
Your suggestions greatly appreciated.About a half-hour after making the changes I outlined above, and long after I closed the active Safari window, noticed that my MBP was uncharacteristically hot. Extremely hot!
Opened Activity Monitor and saw that Flash Player was still running (?) and using a tremendous amount of system resources. I then quit Safari altogether. Within moments, the heat began to subside.
May be something you want to keep an eye on...
Maybe you are looking for
-
i need to delete the extra files but i want to know how to find my original ones.... i am going crazy i dont know why i have sooo many duplicates of my events....
-
How do i remove my credit card information from my iPad
Is there a way to download free apps and still get updates on apps if my credit card is expired.
-
How to open the url link in new window or new tab in Sharepoint
Hello, Am having one custom list and one column name contains type (Hyperlink & picture).I want to open this in a new tab on click I tried but i didn't get any solution even I follow this link also. https://wb2-web.sharepoint.com/blog/Lists/Post
-
Zen V Plus stuck in microphone/recording mode HE
HiMy brand new Zen V Plus is stuck in microphone/recording mode. I've tried holding the back button (which is what you're stupposed to do for more options) but then it just starts recording. AFter I end the recording, I'm back in microphone mode agai
-
Insert picture in illustrator 10
Hi. I try tu insert some picture from file, but i stop in end of my dream's and start of scripting... it's possible in illustrator 10 (java script) if that's possible = true: 1. what kind of file type i need (*.gif, *.psd) 2. how looks code = false: