Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I get the timecode from a live streaming video?

New Here ,
Aug 07, 2014 Aug 07, 2014

Hi all!

I've setup a live streaming video that works fine.  On the server side, we are using The Flash Media Live Encoder streaming to Flash Media Server.   On the server, we have checked the box to add a "Timecode" to the video, and set that to just embed the system time.

On the client side, I have a SWF using the FLVPlayback component.  I can't seem to figure out how to get the Timecode value on the client.  "totalTime" return NaN and "playheadTime" just returns the number of seconds since the client connected.   I need to get the system time/timecode that is being embedded on the server.

Thanks!

TOPICS
ActionScript
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Aug 08, 2014 Aug 08, 2014

FYI - I was able to do it by using the "onFI" handler of the embedded NetStream object.

myVideo.addEventListener(fl.video.VideoEvent.STATE_CHANGE, onVideoStateChange);

function onVideoStateChange(evt:fl.video.VideoEvent)

{

  // trace("State = " + evt.state);

  if ( evt.state == "playing" )

  {

  if (!ns)

  {

  ns = myVideo.getVideoPlayer(evt.vp).netStream;

  ns.client.onFI = onFIHandler;

  }

  }

}

function onFIHandler(infoObj:Object):void

{

  var ts:String = infoObj.st;

  trace("system time: " + ts);

  ExternalIn

...
Translate
Guru ,
Aug 08, 2014 Aug 08, 2014

If the embededd playheadTime gives you false results then start your own timer at the beginning of the video and get its content via currentCount.

//var ticker:timer = new Timer(1000);

ticker.addEventListener(TimerEvent.Timer, tickHandler);

function tickHandler(e:TimerEvent):{

   trace(e.currentCount);

   //outputs 1...2....3... as long as the movie runs every second

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 08, 2014 Aug 08, 2014
LATEST

FYI - I was able to do it by using the "onFI" handler of the embedded NetStream object.

myVideo.addEventListener(fl.video.VideoEvent.STATE_CHANGE, onVideoStateChange);

function onVideoStateChange(evt:fl.video.VideoEvent)

{

  // trace("State = " + evt.state);

  if ( evt.state == "playing" )

  {

  if (!ns)

  {

  ns = myVideo.getVideoPlayer(evt.vp).netStream;

  ns.client.onFI = onFIHandler;

  }

  }

}

function onFIHandler(infoObj:Object):void

{

  var ts:String = infoObj.st;

  trace("system time: " + ts);

  ExternalInterface.call("updateTimeStamp", ts);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines