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, Am running OSX Lion latest version on my Macbook Pro 4,1 and can't get the thing to boot from any source.  Always get's stuck at the grey screen with apple logo.  Have tried all the following... - Straight Boot (power on) - Boot via Recovery HD ( [More]
Is there a way to either run a "Score" thing in Keynote, or a text box that can be typed in during the presentation?Keynote does not have this function. The only way to do this is to use an annotation application. Google and find the cost and fu [More]
Hi everyone, im having a new problem with my sockets, i want to implement a button to stop server but because its client/server architecture it is freezed, how can i separate interface, please help :SLike you say hiwa maybe the problems is the client [More]
how can i hightlight in excel 3 numbers in a column then skip one, and highlight the next? Example: Column A highlight      3 highlight      4 highlight      5 skip            6 highlight      7hold down the cmd (⌘) key while selecting them.Read othe [More]
Hi,        I need to transfer mm values such as base price ,freight,insurance ,excise and cess  ( for trading goods )  to copa. Client wants split  up of trading goods cost . As all the accounts are balanace sheet accounts i am not able to use PA tra [More]
Hi, I have a table in a dynamic interactive PDF form. When the user enters text into a text field of the table, the field can expand over multiple lines. I want to know how I can retrieve the height of the expanded field so that I can resize other el [More]
hello All, when I try to delete or edit any DBA Job in transaction DB13 the following error is displayed: An error occurred when processing system Function DB6_PLAN_DELETE_BATCH failed with return code = Job error How can I fix this error and delete [More]
Trying to sync a video clip to iPad 4 using iTunes. All software up to date. Clip originally in .mts form, but I have converted to .mov, .mp4 and .m4v files. None will sync, even though files clearly shown in number count of files included in sync. F [More]
On returning from holiday Monday afternoon I found that, although I could flick through the TV channels, there was no program information being displayed. I powered down everything and restarted it. Eventually an error message was displayed (C01). I [More]
Hi guys, I'm using lighting 3.3, I just installed it yet for the life of me I can't figure out how to change my work hours. According to the default configuration I'm only in the office from Midnight to 4am and that's far from correct and it's not le [More]