Sitemap

Amicuk Programming Answers

Publish live video & play

-0001-11-30   Views:0

Advertisement

Hi all, i use the code below to publish my cam, and i can play it in the same application. Then i copy and renamer it videoPlayer2.as then i use displayPlaybackVideo(); method but it says "TypeError: Error #1009: Cannot access a property or method of

Hi all, i use the code below to publish my cam, and i can play it in the same application. Then i copy and renamer it videoPlayer2.as then i use
displayPlaybackVideo(); method but it says "TypeError: Error #1009: Cannot access a property or method of a null object reference.". How can i get the published live video from another app.
Thanks..
videoPlayer.as // publish and play
package
     import flash.display.MovieClip;
     import flash.net.NetConnection;
     import flash.net.NetStream;
     import flash.media.Camera;
  import flash.media.Microphone;
     import flash.media.Video;
     import flash.events.NetStatusEvent;
  import fl.video.FLVPlayback;
     public class videoPlayer extends MovieClip
            var nc:NetConnection;
   var ns:NetStream;
   var nsPlayer:NetStream;
   var vid:Video;
   var vidPlayer:Video;
   var cam:Camera;
   var mic:Microphone;
           public function videoPlayer()
                nc=new NetConnection();
                nc.connect("rtmp://localhost/video");
                nc.addEventListener(NetStatusEvent.NET_STATUS,onNetStatus);    
           function onNetStatus(event:NetStatusEvent):void
      trace(event.info.code);
       if(event.info.code == "NetConnection.Connect.Success"){
           publishCamera();
           displayPublishingVideo();
           displayPlaybackVideo();
     function publishCamera() {
        cam = Camera.getCamera();
    cam.setMode(160,120,15);
    cam.setQuality(100000,0);
       mic = Microphone.getMicrophone();
       ns = new NetStream(nc);
       ns.attachCamera(cam);
       ns.attachAudio(mic);
       ns.publish("myCamera", "record");
  function displayPublishingVideo():void {
   vid = new Video(200,200);
   vid.x = 10;
      vid.y = 10;
      vid.attachCamera(cam);
      addChild(vid); 
  function displayPlaybackVideo():void{
      nsPlayer = new NetStream(nc);
      vidPlayer = new Video(200,200);
   nsPlayer.client=this
      nsPlayer.play("myCamera",-1,-1);
   vidPlayer.x = cam.width + 80;
      vidPlayer.y = 10;
      vidPlayer.attachNetStream(nsPlayer);
      addChild(vidPlayer);

The replay answer
Advertisement
if i publish camera in videoPlayer2, displayPlaybackVideo() method is working, but i cannot catch the video whichs is published from videuPlayer.as.
thanks
//videoPlayer.as
package
     import flash.display.MovieClip;
     import flash.net.NetConnection;
     import flash.net.NetStream;
     import flash.media.Camera;
  import flash.media.Microphone;
     import flash.media.Video;
     import flash.events.NetStatusEvent;
  import fl.video.FLVPlayback;
     public class videoPlayer extends MovieClip
            var nc:NetConnection;
            var ns:NetStream;
            var nsPlayer:NetStream;
            var vid:Video;
            var vidPlayer:Video;
            var cam:Camera;
            var mic:Microphone;
           public function videoPlayer()
                nc=new NetConnection();
                nc.connect("rtmp://localhost/video");
                nc.addEventListener(NetStatusEvent.NET_STATUS,onNetStatus);    
           function onNetStatus(event:NetStatusEvent):void
      trace(event.info.code);
       if(event.info.code == "NetConnection.Connect.Success"){
           publishCamera();
           displayPublishingVideo();
           displayPlaybackVideo();
     function publishCamera() {
        cam = Camera.getCamera();
    cam.setMode(160,120,15);
    cam.setQuality(100000,0);
       mic = Microphone.getMicrophone();
       ns = new NetStream(nc);
       ns.attachCamera(cam);
       ns.attachAudio(mic);
       ns.publish("myCamera", "append");
  function displayPublishingVideo():void {
   vid = new Video(200,200);
   vid.x = 10;
      vid.y = 10;
      vid.attachCamera(cam);
      addChild(vid); 
  function displayPlaybackVideo():void{
      nsPlayer = new NetStream(nc);
      vidPlayer = new Video(200,200);
   nsPlayer.client=this
      nsPlayer.play("myCamera",-1,-1);
   vidPlayer.x = cam.width + 80;
      vidPlayer.y = 10;
      vidPlayer.attachNetStream(nsPlayer);
      addChild(vidPlayer);
//videoPlayer2.as
package
     import flash.display.MovieClip;
     import flash.net.NetConnection;
     import flash.net.NetStream;
     import flash.media.Camera;
     import flash.media.Microphone;
     import flash.media.Video;
     import flash.events.NetStatusEvent;
     import fl.video.FLVPlayback;
     public class videoPlayer2 extends MovieClip
            var nc:NetConnection;
            var ns:NetStream;
            var nsPlayer:NetStream;
            var vid:Video;
            var vidPlayer:Video;
            var cam:Camera;
            var mic:Microphone;
           public function videoPlayer2()
                nc=new NetConnection();
                nc.connect("rtmp://localhost/video");
                nc.addEventListener(NetStatusEvent.NET_STATUS,onNetStatus);    
           function onNetStatus(event:NetStatusEvent):void
                trace(event.info.code);
                 if(event.info.code == "NetConnection.Connect.Success"){
                      displayPlaybackVideo();
       function displayPlaybackVideo():void{
                nsPlayer = new NetStream(nc);
                vidPlayer = new Video(200,200);
                nsPlayer.client=this
                nsPlayer.play("myCamera",-1,-1);
                 vidPlayer.x = cam.width + 80;
                 vidPlayer.y = 10;
                vidPlayer.attachNetStream(nsPlayer);
                addChild(vidPlayer);

Go to See the other 5 answers

Why do I not have the option to publish my video demo to Adobe Connect?

Category:DefaultRelease time:2015-10-11Views:130

I'm new to Captivate and recorded a video demo for my co-workers instructing how to set up and run an Adobe Connect Meeting. We have an account to publish Adobe Presenter and Captivate content to Adobe Connect Pro, and use it to host our Adobe Presen[More]

How to publish to video format avi , wmv , mov or mpg ?

Category:DefaultRelease time:-0001-11-30Views:130

How to publish to video format avi , wmv , mov or mpg ?Hello there, You can publish as MP4 from Captivate and then use any video converters to convert from MP4 to whatever format you need. But, as Lilybiri mentioned, there won't be any interactivity[More]

Publishing Event Video to HTML5 ?

Category:DefaultRelease time:-0001-11-30Views:130

I have inserted an event video into a slide and uploaded an mp4 file.  When publishing the project and viewing it in a web broswer, the HTML5 output does not allow for any video controls, and as such the video does not play. I cannot publish the vide[More]

Bug in which Premiere does not allow publishing of videos to YouTube over 15 minutes.

Category:DefaultRelease time:-0001-11-30Views:130

When I try to publish a video to YouTube over 15 minutes I get this error: "The video duration exceeds the maximum duration supported by the destination.  Please reduce the duration of video and try again."  Clearly YouTube's policies change ove[More]

Publish live video & play

Category:DefaultRelease time:-0001-11-30Views:130

Hi all, i use the code below to publish my cam, and i can play it in the same application. Then i copy and renamer it videoPlayer2.as then i use displayPlaybackVideo(); method but it says "TypeError: Error #1009: Cannot access a property or method of[More]

When I publish a video, I lose half of the audio in "audio 2". I can hear it while editing. How do I fix this?

Category:DefaultRelease time:-0001-11-30Views:130

I published a video as an mpeg, and when I listened to the final product it was missing some music I had in the "audio 2" slot. How do I fix this?Cameron Is the problem Audio Track 2 music from any of your royalty free music websites? Is the sou[More]

Publishing a video in Premiere Elements 12

Category:DefaultRelease time:-0001-11-30Views:130

When trying to publish a video to my computer, I get an error message "Error compiling movie. You do not have permission to create or delete the output file." How do I take care of this? I cant pyublish my videos. Larry WierciakLarry Wierciak Wh[More]

When I try to publish a video in CS5 it adds the extension .new. Help please!

Category:DefaultRelease time:-0001-11-30Views:130

When I try to publish a video in CS5 it adds the extension .new. Help please!Your video is encoded in a format that PS doesn't understand. It's as easy as that. AVIs are just containers that can contain a multitude of different CoDecs and settings. Y[More]

Increasing bandwidth while publishing live video

Category:DefaultRelease time:-0001-11-30Views:130

Hi all,      I have made a sample application for publishing video through FMS using as3.      In that I had used the same code as given in the sample provided by the adobe,      m_nc = new NetConnection("rtmpt://localhost:1935/Test");      priv[More]

When I published my video to youtube, does the video also exist anywhere locally on my Mac?

Category:DefaultRelease time:-0001-11-30Views:130

When I published my video to youtube, does the video also exist anywhere locally on my Mac? Thanks for answering..Hi MyAppleID99, You may want to check to make sure the clip hasn't been moved back and forth between wide screen and standard aspect rat[More]

CP7 - unable to publish a video tutorial

Category:DefaultRelease time:-0001-11-30Views:130

Hello, I am new to Captivate, but I have previsously managed to publish video tutorials. Since yesterday I am trying to publish a new one and always get this message: I am quite sure I don't have any network issues at the office. I have tried to sele[More]

Hot
Hi In the following program the task5 routine takes ~3s to complete, when I uncomment the t2 lines it takes 11s (this is on a quad-core x86/64 machine). Since there is no explicit synchronization I was expecting 3s in both cases. public static int sd [More]
I've been given an HP Laserjet 2100 TN. It was previously suceessfully used with a MacBook pro via an ethernet cable. I'm trying to set it up at home but failing to get it to connect with my MacBook. I'm using Snow Leopard. I've read lots of connecti [More]
I am facing a problem which I cannot seem to solve. It involves Swing and threads. I have a main GUI running on swing. And it retrieves database information and displays it. On the same GUI I have a JTextArea box which I need another thread to update [More]
HI, I need to get a report as how many times user  is connected to the project server in a week. I have enabled web analytical reports but its showing only how many times a user is connected to site.I need date also Project server 2010 version. Can a [More]
Since i got my macbook pro for christmas last year i haven't had a single problem with it. Now all of a sudden my volume keys at the top of the keyboard aren't working unless i hold the function key down-which can be a pain. I haven't change a thing [More]
Hi all,      I am currently working on a report that takes the SPOOL NO. for the back ground runned job and passes to the Function module 'RSPO_RETURN_SPOOLJOB' that gives the data in BUFFER after reading this data I am converting it to the excel for [More]
Hi Guys, This is an easy question for SRM gurus =) I need to send the PO in format XML to the vendors (using XI).    When I try to send a PO I can see this error message in "Issue Purchase Order" option menu. Information  Date: 13.06.2006 Time: [More]
good day, I am hoping someone can assist me with getting one of my new sites up and running. I am still on Dreamweaver CS3 as my hard drive at thsi time can not support hte size of CS4. I have created a new website for a friend of mine and she has pr [More]
Anyone seen this error before? thanks, -sancho An error occurred when attempting to call the providers register function. (WWC-43134) An unexpected error occurred: ORA-29532: Java call terminated by uncaught Java exception: Unexpected EOF. (WWC-43000 [More]
Hi , We need to map ICT and SIP trunk into the same route group  ,but the problem here is already same ICT is mapped to another route pattern. If i try to create new ICT with same remote IP ,it's throwing Add failed because the remote IP is already d [More]