Solved

flex - displaying time of playing videos in HH:MM:SS:FF format

Posted on 2009-05-13
2
1,090 Views
Last Modified: 2013-11-11
Hi!
I have some application which controls a flv video. I am using DateFormatter to format play time display and it is in HH:MM:SS format.
What I would like to do is to display it with HH:MM:SS:FF format (FF = frames: from 00 to 25).

Is this possible with DateFormatter or should i "fake" it somehow?

In addition, I am attaching part of code which is relevant to my problem..

Thanks for helping!
private var start:Date;

private var timeDisplayFormatter:DateFormatter;
 

private function init():void{

	start = new Date("1/1/2000");

	timeDisplayFormatter = new DateFormatter();

	playtime.text = "00:00:00:00";

	

	loadedVideo.addEventListener(VideoEvent.READY,videoReady);

	loadedVideo.addEventListener(VideoEvent.PLAYHEAD_UPDATE,updateTimeDisplay);

	

	playButton.addEventListener(MouseEvent.CLICK, togglePlayback);

}
 

private function togglePlayback(event:MouseEvent):void{

	if (loadedVideo.playing){

		loadedVideo.pause();

	} else if (loadedVideo.source){

		loadedVideo.play();

	}

}
 

private function videoReady(event:VideoEvent):void{

	

	timeDisplayFormatter.formatString = "JJ:NN:SS";

	

	var totalTime:Date = new Date(start.getTime()+ (this.loadedVideo.totalTime*1000));

	

	videoLength = timeDisplayFormatter.format(totalTime);

	

}
 

private function updateTimeDisplay(event:VideoEvent):void{

	

	timeDisplayFormatter.formatString = "JJ:NN:SS";

	

	var currentTime:Date = new Date(start.getTime()+ (event.playheadTime * 1000) );

	

	playtime.text = timeDisplayFormatter.format(currentTime);

	

}

Open in new window

0
Comment
Question by:joy_de_vivre
2 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 24383299
Hi, my thoughts. a video is based on playback time, not frames. so if you want to and you know there's 25 frames you may have to fake it and work out playback time vs number of frames and do a guestimate at what frame you're at.
0
 

Author Closing Comment

by:joy_de_vivre
ID: 31581240
ok, you are the only one with actual thoughts about this... thanks for efforts =)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SWF won't scale? 4 520
Flash content not working in IE 11 on Windows 8.1 3 155
Install adobe flash plugin for Firefox win 7 9 68
Flash Converter 8 113
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now