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
I installed a MOTU 828 mk3 Firewire audio interface to use with my Logic Express 7 several years ago and have used it consistently ever since. No big issues. A few weeks ago a friend attempted to install a new audio driver unsuccessfully. Now Logic w [More]
I just plugged in a HDMI cable from my PC to my TV, I did the thing in which i can slide the bars across each screen but I can only play sounds either from my TV or from my PC, what can i do so that I can hear both simultaneously?Right Click on Speak [More]
Hello All, Very tired at the moment, so hoping someone can kickstart my brain, preferably with an answer to a problem that I'd probably be able to solve given 10 hours of sleep... Using the community version of Forte 1.3. Just built an applet (extend [More]
Hi guys, I noticed there is a slight light grey border around the edges of my videos when I play it on my iPad. The border is on the edges of the video itself and not the actual box/wrapper the video is going into. I ensured the video has no border w [More]
First let me just say that edge is great tool, and makes our life much easier. well.. i'm trying to get familiar with the program and I run into some obstacles. on the stage i have a symbol, inside that symbol i have a button, which i need it to run [More]
I have an iPhone 5S 64 GB and an iPod Nano 6th generation 16 GB that I sync to a windows based PC. I have 15.28 GB of music on my PC. It fits nicely as is and at the higher bitrate. I would love to put all that music on my iPod. I am curious if I con [More]
Hi All, We have a case in which we need to send a Adobe interactive form as an attachment to approver's email address(outlook) and perform offline approval. Could you pls help me guiding how to achieve this? System is mySAP ECC 6.0. (I have heard tha [More]
hello, i have a series of ad banners which must fall within a 35kb size allowance. The banners aren't huge and the main image file is 12kb (JPEG) at the smallest, any smaller and there's a noticeable degrade in image quality. The swf's are coming out [More]
After updating to iOS 6 p, gyrocompass does't load. How can I fix this app ?Have you also asked in the Adobe forums?  To have people read your post, best not to include long crash reports until asked to do so.Read other 2 answers [More]
I know this issue has been already covered in some threads, but I don't know if the answer is still the same after 2.0 OS and the increment of Apps available since last year. I ordered a Playbook (to be received tomorrow :-) ) and after some investig [More]