Results 1 to 2 of 2

Thread: Help with AS2 RTMP player

  1. #1
    Join Date
    Oct 2013

    Default Help with AS2 RTMP player


    I'm attempting to write an AS2 RTMP player, compiled using MTASC, doing everything programatically rather than using the Flash IDE.

    I must use AS2 since it is for a Smart TV device that does not support AS3. I think the code is almost there and know almost zero about Actionscript but I am vaguely aware that I need to add something along the lines of createEmptyMovieClip ( ..., ... ) and add it to the stage to finish the code below but my attempts have been fruitless. Is someone able to tell me what exactly I need to do to get the following code to actually display the video, or better still direct me to a complete AS2 player with onscreen controls that I can adapt?


    class RTMPPlayer extends MovieClip {
    	private var url;
    	private var videoname;
    	private var my_nc;
    	private var my_ns;
    	private var video:Video;
    	public function RTMPPlayer ( mc ) {
    		my_nc = new NetConnection ( );			
    		url = "rtmpt://";
    		videoname = "mp4:videos/Qvxp3Jnv-483";
    		my_nc.connect ( url );		
    		my_ns = new NetStream ( my_nc );
    		video = new Video();
    		video.width = 1280;
    		video.height = 720;
    		video.attachVideo ( my_ns );
    		my_ns.setBufferTime ( 2 ); ( videoname );		
    	public static function main ( mc:MovieClip ) : Void {	
    		var test = new RTMPPlayer ( mc );	

  2. #2
    Join Date
    Jul 2013


    I believe you need to listen for a success status from NetConnection, you can't just throw all of the connecting and playing in to one function like you are.

    See this thread for some AS2 snippets.

    However, here should have an AS2 player (version 2.0.5 seems to be AS2).

Similar Threads

  1. Replies: 1
    Last Post: 09-26-2014, 10:55 AM
  2. Live broadcast, with AS2 and Transcoder, black screen.
    By devideen10 in forum General Forum
    Replies: 4
    Last Post: 07-17-2014, 08:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts