<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Automatic Bandwidth Detection for SMIL + FLVPlayback + Progressive Downloads</title>
	<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/</link>
	<description>where matthew tretter types stuff</description>
	<pubDate>Mon, 01 Dec 2008 17:05:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Jim W</title>
		<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-524</link>
		<dc:creator>Jim W</dc:creator>
		<pubDate>Mon, 02 Jun 2008 15:16:59 +0000</pubDate>
		<guid>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-524</guid>
		<description>As a quick solution, I've used the FLV pathname to switch - but this would become cumbersome with larger directory paths and perhaps dynamic paths.</description>
		<content:encoded><![CDATA[<p>As a quick solution, I&#039;ve used the FLV pathname to switch - but this would become cumbersome with larger directory paths and perhaps dynamic paths.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim W</title>
		<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-523</link>
		<dc:creator>Jim W</dc:creator>
		<pubDate>Mon, 02 Jun 2008 15:03:48 +0000</pubDate>
		<guid>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-523</guid>
		<description>I'm trying to use your detection once for two sets of videos - high bandwidth and low bandwidth. Each set is contained in two arrays, but from the info above, it looks like the src value must point to an FLV in order for the checking to occur - am I correct?

If so, is there a way that I can just pass a value based on the bitrate and then determine the FLV for playback? Currently I'm trying this:


//			Function determining which Array to use

function setBandwidth():Array
{
	
	var bandwidth:String = 'example.smil';
	
	switch (bandwidth)
	{
		
		case "HI":
			return(HiBandArray);
			break;
		
		case "LO":
			return(LoBandArray);
			break;
		
		default:
			trace ("defaulted!");
			return(LoBandArray);
			break;
		
	}
	
}</description>
		<content:encoded><![CDATA[<p>I&#039;m trying to use your detection once for two sets of videos - high bandwidth and low bandwidth. Each set is contained in two arrays, but from the info above, it looks like the src value must point to an FLV in order for the checking to occur - am I correct?</p>
<p>If so, is there a way that I can just pass a value based on the bitrate and then determine the FLV for playback? Currently I&#039;m trying this:</p>
<p>//			Function determining which Array to use</p>
<p>function setBandwidth():Array<br />
{</p>
<p>	var bandwidth:String = &#039;example.smil&#039;;</p>
<p>	switch (bandwidth)<br />
	{</p>
<p>		case &#034;HI&#034;:<br />
			return(HiBandArray);<br />
			break;</p>
<p>		case &#034;LO&#034;:<br />
			return(LoBandArray);<br />
			break;</p>
<p>		default:<br />
			trace (&#034;defaulted!&#034;);<br />
			return(LoBandArray);<br />
			break;</p>
<p>	}</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Jeffers</title>
		<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-149</link>
		<dc:creator>Jim Jeffers</dc:creator>
		<pubDate>Wed, 19 Mar 2008 15:04:56 +0000</pubDate>
		<guid>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-149</guid>
		<description>	&lt;p&gt;Oh man!  That makes sense I don&#8217;t know why I didn&#8217;t even realize that was the problem.  We had another guy in the office who had an install of flash 9 that had yet to be updated.  It compiled for him.  Pretty crazy that Adobe modified the language in Flash CS3 after it had been officially released for quite some time.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Oh man!  That makes sense I don&#039;t know why I didn&#039;t even realize that was the problem.  We had another guy in the office who had an install of flash 9 that had yet to be updated.  It compiled for him.  Pretty crazy that Adobe modified the language in Flash CS3 after it had been officially released for quite some time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matthew</title>
		<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-148</link>
		<dc:creator>matthew</dc:creator>
		<pubDate>Wed, 19 Mar 2008 13:10:07 +0000</pubDate>
		<guid>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-148</guid>
		<description>	&lt;p&gt;@Luke:&lt;br /&gt;
Check out the BandwidthChecker class.  It's included in the download.&lt;/p&gt;

	&lt;p&gt;@PDL:&lt;br /&gt;
This is a Flash solution.  Just embed a SWF like in the &lt;a href="http://exanimo.com/examples/as3/NCManagerAuto/"&gt;example&lt;/a&gt;.  If you want to load different videos using the same SWF, just pass the SWF the URL of your SMIL file.&lt;/p&gt;

	&lt;p&gt;@jim, mteguh:&lt;br /&gt;
That was an error on my part. I've replaced &lt;code&gt;new LoaderInfo().url&lt;/code&gt; with &lt;code&gt;new Loader().contentLoaderInfo.loaderURL&lt;/code&gt;.  Your solution is neat, mteguh, but I think it's off the mark for two reasons: 1) it requires JavaScript and 2) I believe we actually want the URL of the SWF (not the html container).  The confusion is that (for some stupid reason) Flash expects FLV sources to be relative to the SWF, even though Loader and URLLoader treat URLs as being relative to the HTML container.  Since we're using URLLoader to check the bandwidth (BandwidthChecker wraps URLLoader), we must account for the fact that the provided FLV source is relative to the location of the SWF.  We do this by resolving the URL to the directory of the SWF.  The ZIP file has been updated and the new code is checked into subversion.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>@Luke:<br />
Check out the BandwidthChecker class.  It&#039;s included in the download.</p>
<p>@PDL:<br />
This is a Flash solution.  Just embed a SWF like in the <a href="http://exanimo.com/examples/as3/NCManagerAuto/">example</a>.  If you want to load different videos using the same SWF, just pass the SWF the URL of your SMIL file.</p>
<p>@jim, mteguh:<br />
That was an error on my part. I&#039;ve replaced <code>new LoaderInfo().url</code> with <code>new Loader().contentLoaderInfo.loaderURL</code>.  Your solution is neat, mteguh, but I think it&#039;s off the mark for two reasons: 1) it requires JavaScript and 2) I believe we actually want the URL of the SWF (not the html container).  The confusion is that (for some stupid reason) Flash expects FLV sources to be relative to the SWF, even though Loader and URLLoader treat URLs as being relative to the HTML container.  Since we&#039;re using URLLoader to check the bandwidth (BandwidthChecker wraps URLLoader), we must account for the fact that the provided FLV source is relative to the location of the SWF.  We do this by resolving the URL to the directory of the SWF.  The ZIP file has been updated and the new code is checked into subversion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mteguh</title>
		<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-144</link>
		<dc:creator>mteguh</dc:creator>
		<pubDate>Sun, 24 Feb 2008 00:47:01 +0000</pubDate>
		<guid>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-144</guid>
		<description>	&lt;p&gt;Just confirmed that the example file given is also hosed in IE.&lt;br /&gt;
Making this change seems to fix it tho. Anyhow this is cool stuff.&lt;br /&gt;
Thx&lt;/p&gt;

	&lt;p&gt;var serverPath:String = &#8220;&#8221;;
				
				try {
					serverPath = new LoaderInfo().url.split(&#8217;/&#8217;).slice(0, -1).join(&#8217;/&#8217;);
				} catch (e:Error) {
					serverPath = ExternalInterface.call( &#8216;function(){ return window.location.toString(); }&#8217; );
					serverPath = (serverPath)? serverPath : &#8220;&#8221;;
				}&lt;/p&gt;

	&lt;p&gt;				//var myBandwidthChecker = new BandwidthChecker(URLUtil.getFullURL(new LoaderInfo().url.split(&#8217;/&#8217;).slice(0, -1).join(&#8217;/&#8217;), URLUtil.getFullURL(_streamName, _streams&lt;sup class="footnote"&gt;&lt;a href="#fn164224018447c0cc95c8f4f"&gt;0&lt;/a&gt;&lt;/sup&gt;.src)));
				var myBandwidthChecker = new BandwidthChecker(URLUtil.getFullURL(serverPath, URLUtil.getFullURL(_streamName, _streams&lt;sup class="footnote"&gt;&lt;a href="#fn164224018447c0cc95c8f4f"&gt;0&lt;/a&gt;&lt;/sup&gt;.src)));&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Just confirmed that the example file given is also hosed in IE.<br />
Making this change seems to fix it tho. Anyhow this is cool stuff.<br />
Thx</p>
<p>var serverPath:String = &#034;&#034;;</p>
<p>				try {<br />
					serverPath = new LoaderInfo().url.split(&#039;/&#039;).slice(0, -1).join(&#039;/&#039;);<br />
				} catch (e:Error) {<br />
					serverPath = ExternalInterface.call( &#039;function(){ return window.location.toString(); }&#039; );<br />
					serverPath = (serverPath)? serverPath : &#034;&#034;;<br />
				}</p>
<p>				//var myBandwidthChecker = new BandwidthChecker(URLUtil.getFullURL(new LoaderInfo().url.split(&#039;/&#039;).slice(0, -1).join(&#039;/&#039;), URLUtil.getFullURL(_streamName, _streams<sup class="footnote"><a href="#fn164224018447c0cc95c8f4f">0</a></sup>.src)));<br />
				var myBandwidthChecker = new BandwidthChecker(URLUtil.getFullURL(serverPath, URLUtil.getFullURL(_streamName, _streams<sup class="footnote"><a href="#fn164224018447c0cc95c8f4f">0</a></sup>.src)));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mteguh</title>
		<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-143</link>
		<dc:creator>mteguh</dc:creator>
		<pubDate>Sat, 23 Feb 2008 23:45:58 +0000</pubDate>
		<guid>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-143</guid>
		<description>	&lt;p&gt;Yes I am also getting the same error message.&lt;br /&gt;
ArgumentError: Error #2012: LoaderInfo class cannot be instantiated.
	at com.exanimo.video::NCManagerAuto/helperDone()
	at fl.video::SMILManager/http://www.adobe.com/2007/flash/flvplayback/internal::xmlLoadEventHandler()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at flash.net::URLLoader/onComplete()&lt;/p&gt;

	&lt;p&gt;And seems like it only happens in IE, which is weird coz flash is supposed to be crossbrowser?&lt;br /&gt;
In Firefox and in the &lt;span class="caps"&gt;IDE&lt;/span&gt; it works fine.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Yes I am also getting the same error message.<br />
ArgumentError: Error #2012: LoaderInfo class cannot be instantiated.<br />
	at com.exanimo.video::NCManagerAuto/helperDone()<br />
	at fl.video::SMILManager/http://www.adobe.com/2007/flash/flvplayback/internal::xmlLoadEventHandler()<br />
	at flash.events::EventDispatcher/dispatchEventFunction()<br />
	at flash.events::EventDispatcher/dispatchEvent()<br />
	at flash.net::URLLoader/onComplete()</p>
<p>And seems like it only happens in IE, which is weird coz flash is supposed to be crossbrowser?<br />
In Firefox and in the <span class="caps">IDE</span> it works fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Jeffers</title>
		<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-137</link>
		<dc:creator>Jim Jeffers</dc:creator>
		<pubDate>Thu, 24 Jan 2008 16:42:49 +0000</pubDate>
		<guid>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-137</guid>
		<description>	&lt;p&gt;This is a bit odd.  Probably a novice AS3 issue.  When I try to compile the example with a supplied set of FLVs and &lt;span class="caps"&gt;SMIL&lt;/span&gt; I get this error in my ouput:&lt;/p&gt;

	&lt;p&gt;ArgumentError: Error #2012: LoaderInfo class cannot be instantiated.
	at com.exanimo.video::NCManagerAuto/helperDone()
	at fl.video::SMILManager/http://www.adobe.com/2007/flash/flvplayback/internal::xmlLoadEventHandler()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at flash.net::URLLoader/onComplete()&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>This is a bit odd.  Probably a novice AS3 issue.  When I try to compile the example with a supplied set of FLVs and <span class="caps">SMIL</span> I get this error in my ouput:</p>
<p>ArgumentError: Error #2012: LoaderInfo class cannot be instantiated.<br />
	at com.exanimo.video::NCManagerAuto/helperDone()<br />
	at fl.video::SMILManager/http://www.adobe.com/2007/flash/flvplayback/internal::xmlLoadEventHandler()<br />
	at flash.events::EventDispatcher/dispatchEventFunction()<br />
	at flash.events::EventDispatcher/dispatchEvent()<br />
	at flash.net::URLLoader/onComplete()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PDL</title>
		<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-131</link>
		<dc:creator>PDL</dc:creator>
		<pubDate>Thu, 20 Dec 2007 17:53:47 +0000</pubDate>
		<guid>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-131</guid>
		<description>	&lt;p&gt;I understand the structure of the smil , my question is how do you actually embed this into your html/php code? We are looking to have 2, possibly 3 bitrate/size versions of each of our videos and I don&#8217;t understand how to link to this in a page.&lt;/p&gt;

	&lt;p&gt;Thanks&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>I understand the structure of the smil , my question is how do you actually embed this into your html/php code? We are looking to have 2, possibly 3 bitrate/size versions of each of our videos and I don&#039;t understand how to link to this in a page.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-123</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Mon, 19 Nov 2007 02:19:38 +0000</pubDate>
		<guid>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-123</guid>
		<description>	&lt;p&gt;Hey there,&lt;/p&gt;

	&lt;p&gt;This is &lt;strong&gt;almost&lt;/strong&gt; what I was looking for, pretty transparent way to detect bandwidth. But what about simply turning videos on or off based on connection speed. For our dialup users, we want to disable videos entirely. Could I use something like ContentPath = null, and myFLVPlayback._visible=false?&lt;/p&gt;

	&lt;p&gt;Cheers,&lt;br /&gt;
Luke&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Hey there,</p>
<p>This is <strong>almost</strong> what I was looking for, pretty transparent way to detect bandwidth. But what about simply turning videos on or off based on connection speed. For our dialup users, we want to disable videos entirely. Could I use something like ContentPath = null, and myFLVPlayback._visible=false?</p>
<p>Cheers,<br />
Luke</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matthew</title>
		<link>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-122</link>
		<dc:creator>matthew</dc:creator>
		<pubDate>Wed, 14 Nov 2007 02:04:29 +0000</pubDate>
		<guid>http://exanimo.com/actionscript/automatic-bandwidth-detection-for-smil/#comment-122</guid>
		<description>	&lt;p&gt;Actually, when you use a &lt;span class="caps"&gt;SMIL&lt;/span&gt; file with an &lt;span class="caps"&gt;RTMP&lt;/span&gt; server, you need to set the application (rtmp://xx.xx.xx.xx/test_video) in the meta tag.  Try this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&#60;?xml version="1.0" encoding="utf-8"?&gt;
&#60;!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN"
    "http://www.w3.org/2001/SMIL20/SMIL20.dtd"&gt;
&#60;smil xmlns="http://www.w3.org/2001/SMIL20/Language"&gt;
    &#60;head&gt;
        &#60;meta base="rtmp://xx.xx.xx.xx/test_video" /&gt;
    &#60;/head&gt;
    &#60;body&gt;
        &#60;switch&gt;
            &#60;video src="_definst_/movies/video2.flv" system-bitrate="512000" /&gt;
            &#60;video src="_definst_/movies/video1.flv" system-bitrate="256000" /&gt;
            &#60;video src="_definst_/movies/video0.flv" /&gt;
        &#60;/switch&gt;
    &#60;/body&gt;
&#60;/smil&gt;&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Actually, when you use a <span class="caps">SMIL</span> file with an <span class="caps">RTMP</span> server, you need to set the application (rtmp://xx.xx.xx.xx/test_video) in the meta tag.  Try this:</p>
<pre><code>&lt;?xml version="1.0" encoding="utf-8"?>
&lt;!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN"
    "http://www.w3.org/2001/SMIL20/SMIL20.dtd">
&lt;smil xmlns="http://www.w3.org/2001/SMIL20/Language">
    &lt;head>
        &lt;meta base="rtmp://xx.xx.xx.xx/test_video" />
    &lt;/head>
    &lt;body>
        &lt;switch>
            &lt;video src="_definst_/movies/video2.flv" system-bitrate="512000" />
            &lt;video src="_definst_/movies/video1.flv" system-bitrate="256000" />
            &lt;video src="_definst_/movies/video0.flv" />
        &lt;/switch>
    &lt;/body>
&lt;/smil></code></pre>
]]></content:encoded>
	</item>
</channel>
</rss>
