<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>mandarin.no &#187; totalTime</title>
	<atom:link href="http://mandarin.no/tag/totaltime/feed/" rel="self" type="application/rss+xml" />
	<link>http://mandarin.no</link>
	<description></description>
	<lastBuildDate>Tue, 17 Aug 2010 09:35:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>totalTime and MetadataReceived from VideoDisplay object in Flex</title>
		<link>http://mandarin.no/as3/totaltime-and-metadatareceived-from-videodisplay-object-in-flex-2/</link>
		<comments>http://mandarin.no/as3/totaltime-and-metadatareceived-from-videodisplay-object-in-flex-2/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 16:53:15 +0000</pubDate>
		<dc:creator>Thomas Viktil</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[bufferTime]]></category>
		<category><![CDATA[MetadataReceived]]></category>
		<category><![CDATA[totalTime]]></category>
		<category><![CDATA[VideoDisplay]]></category>
		<guid isPermaLink="false">http://mandarin.no/as3/totaltime-and-metadatareceived-from-videodisplay-object-in-flex-2/</guid>
		<description><![CDATA[Interesting (and more than a bit annoying) observation; neither the property totalTime or the event MetadataEvent.METADATA_RECEIVED will trigger unless the buffer is full. I just discovered this as I tried to dynamically set the bufferTime to be 30% of the total playtime (I calculate the bufferTime using totalBytes and bytesLoaded). But as I traced values [...]]]></description>
			<content:encoded><![CDATA[<p>Interesting (and more than a bit annoying) observation; neither the property totalTime or the event MetadataEvent.METADATA_RECEIVED will trigger unless the buffer is full.</p>
<p>I just discovered this as I tried to dynamically set the bufferTime to be 30% of the total playtime (I calculate the bufferTime using totalBytes and bytesLoaded). But as I traced values like totalTime, I noticed it would stay at -1 until the video started playing (in other words; the buffer was full). Just for the sake of curiosity I set up an eventlistener listening for the duration property of the MetadataReceived event object. Interesting enough it wouldn&#8217;t trigger until the buffer was full.</p>
<p>It has been filed as a bug at <a href="http://bugs.adobe.com/jira/browse/SDK-14948" target="_blank">Adobe&#8217;s Flex Bug and Issues Management System</a>.</p>
<p>Possible workaround:
<ol>
<li>set bufferTime to 0 at initialization (this would hopefully trigger the READY event (or MetadataReceived if you prefer)</li>
<p>
<li>catch the totalTime value</li>
<p>
<li>pause/stop the video</li>
<p>
<li>increase bufferTime (or skip number 3 and go directly to number 4. It might work?)</li>
<p></ol>
<p>Technorati Tags: <a class="performancingtags" href="http://technorati.com/tag/flex" rel="tag">flex</a>, <a class="performancingtags" href="http://technorati.com/tag/as3" rel="tag">as3</a>, <a class="performancingtags" href="http://technorati.com/tag/actionscript" rel="tag">actionscript</a>, <a class="performancingtags" href="http://technorati.com/tag/meta%20data" rel="tag">meta data</a>, <a class="performancingtags" href="http://technorati.com/tag/video" rel="tag">video</a>, <a class="performancingtags" href="http://technorati.com/tag/development" rel="tag">development</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mandarin.no/as3/totaltime-and-metadatareceived-from-videodisplay-object-in-flex-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
