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
For development purposes, we created a Hyper-V VM running Windows 7 with BizTalk Server 2010 installed running against a SQL Express database. We also installed Visual Studio (licensed) for map development. Over time, the BizTalk tables grow, and are [More]
Hello all,                Earlier today my iMessage wasn't working. I tried everything but unfortunately, had no luck. I decided to reset the iPhone to factory settings and the screen decided to stay in restoration mode all day. This is the screen I' [More]
Hi Experts,   I have a table control which displays list of material details. I have a button to upload the material details from excel file to table control directly. I have to validate all the customers which are exist in the table. But my item (Ma [More]
So right  now I am on a family plan with my Dad and mother and we all have old phones that are basic basic. Our family plan has no Data plan at all, and in fact the plan is so old that it does not exist anymore. However I am moving away soon and I wa [More]
Hi Indesign Experts,               I've a big issue with indesign. I'm trying to display the contents as in Story editor including tags in alert or in some output window panel. But the texts are displayed. But I can't get the tags. It's displayed lik [More]
When I choose my custom Google News items, eg. Cold Fusion, Rossi, UFO, etc. The next time I open the browser they are gone and the standard generic Google News pages are back.Can you try clearing your cache and cookies? Also make sure your cookies a [More]
Hi, i got some problems, maybe because i'm a beginer. I am creating with jdeveloper webcenter suite, a web portal. I learn that i need to connect my web in to a database to can run and try to use my web portal. Now, i'm trying to create a database in [More]
Hello there, we got a new problem with our InDesign CS5. Since some weeks, when we open external files (send by mail or from a portable device) and want to close them (only this window), the full program gets closed. No crash-report, nothing. If we u [More]
Hi Guys, I have created a Sharepoint page and have my Fields and deleted the default one. But now the page can't be open with the mobile device (mobile view), because the "percentcomplete" field is not avaliable. Is there any workaround, so I do [More]
I just installed adobe reader XI and now I can't open any PDF files. The application itself won't even start properly. The default window opens but then it completely shutsdown without any indication of why it did so. No error report or anything.I fo [More]