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
제품: FIN_AR 작성날짜 : 2006-11-03 AR_PAYMENT_SCHEDULES_ALL TABLE의 DATA생성 로직 ========================================= Explanation 입력된 Transaction이 Complete되는 시점에 AR_PAYMENT_SCHEDULES_ALL table에 관련 Data row가 생성되며, Due_date는 입력된 Transaction의 due_date를 끌고 와서 [More]
Hi All, My report included 2 pages. Problem is the final total cannot appear when the last line item reached the page end. (page 2) final total will appear on the middle of last page (page 3) when i comment (type    = 'BOTTOM'). Below is the program. [More]
How to remove or uninstalled completely application in MacBook Pro?If all you did to install an application was drag it to the Applications folder, it will be completely uninstalled by dragging it to the Trash and emptying the Trash. How many other f [More]
I have a NETGEAR WRG614 wireless router, a G5 iMac 2.0 isight (wired) which is my primary computer, a MBP C2D 2.33 17"(wireless) and a iBook G4 1.33ghz (wireless). I can use iChat no problem as far as text chats go on all machines. I can video chat w [More]
i am not able to figure out how to sync my calendar on my computer with my iphone. i have shred my calendar with my girlfiend, no problem. when i change my calendar on my computer she gets the updates, but i can't get it to update on my iphone 5s. i [More]
I am trying to make a video with a moving green screen like the one seen here. I know I can do it using Motion, but do I need FCP X to use Motion? Can I just use Motion 5 to make my video? I am an not a pro. I just make some home videos for friends a [More]
Hello again, I am looking for an easy method to determine whether a File or Folder object point to an actual file or to a folder. Both objects seem to have the same set of properties, except the File element has more. But the Data Browser in the ESTK [More]
I am a graduate student and teacher and have thousands of PDFs to read each semester for my classes and research. I looked into every eReader on the market for months before buying a Sony PRS900 (I would have gone with the 950, but couldn't fund the [More]
Hi Experts Related to the previous discussion on the installation number for the iCI CCM Extractor, even if the installation is correct, I do not get any data in the 0SM_ESRSG cube even though records are returned from the extractor. This, I believe, [More]
Just wondering if any third party folks have provided a plug-in for compressor 3 (similar to something like Flip4Mac) that would allow burning to Blu-Ray media? Thanks, Rob.Jon, I think the rush will start and it will be very much like VHS to DVD. I [More]