<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to Play Flash Video Files (FLV) Sequentially</title>
	<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Wed, 19 Nov 2008 04:25:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Arunava</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-290459</link>
		<pubDate>Thu, 23 Oct 2008 10:28:39 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-290459</guid>
					<description>David,

Thanks very much for such an excellent article. It has helped me to a great extent. 

However, will you please help me out with the following problem: 

My video player will be playing two videos sequentially. When the first video plays, the second video will preload in the background. How to implement the background preloading with the existing code?

Thanks in advance!!</description>
		<content:encoded><![CDATA[<p>David,</p>
<p>Thanks very much for such an excellent article. It has helped me to a great extent. </p>
<p>However, will you please help me out with the following problem: </p>
<p>My video player will be playing two videos sequentially. When the first video plays, the second video will preload in the background. How to implement the background preloading with the existing code?</p>
<p>Thanks in advance!!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: becca</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-264091</link>
		<pubDate>Fri, 05 Sep 2008 10:08:00 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-264091</guid>
					<description>GREAT POST!

I was wondering if there is a way to add fade in and out transition between movies and loop?

Thanks in advance for all your help.</description>
		<content:encoded><![CDATA[<p>GREAT POST!</p>
<p>I was wondering if there is a way to add fade in and out transition between movies and loop?</p>
<p>Thanks in advance for all your help.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-247007</link>
		<pubDate>Tue, 12 Aug 2008 02:52:33 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-247007</guid>
					<description>Matt,

&lt;blockquote&gt;I’m sure it can be done better but it works for me.&lt;/blockquote&gt;

I find that to be true of most of my work!  Sometimes it depends on deadlines, budget, a combination of those, or something else altogether.  ;)

You might want to consider a tweak to this portion of your code:

&lt;pre&gt;&lt;code&gt;if (_vidURL.indexOf(
    &amp;#34;rtmp://&amp;#34; &amp;#124;&amp;#124; &amp;#34;RTMP://&amp;#34; &amp;#124;&amp;#124; &amp;#34;RTMPE://&amp;#34; &amp;#124;&amp;#124;
    &amp;#34;RTMPS://&amp;#34; &amp;#124;&amp;#124; &amp;#34;rtmpe://&amp;#34; &amp;#124;&amp;#124; &amp;#34;rtmps://&amp;#34;
  ) &gt; -1) {&lt;/code&gt;&lt;/pre&gt;

... only because, if you really want to play it safe, you may want to account for variants besides all-lowercase or all-uppercase.  One trick I've seen pretty often is to use &lt;code&gt;String.toLowerCase()&lt;/code&gt; in the comparison expression to evaluate the target string in all lowercase ...

&lt;pre&gt;&lt;code&gt;if (_vidURL.toLowerCase().indexOf(
    &amp;#34;rtmp://&amp;#34; &amp;#124;&amp;#124; &amp;#34;rtmpe://&amp;#34; &amp;#124;&amp;#124; &amp;#34;rtmps://&amp;#34;
  ) &gt; -1) {&lt;/code&gt;&lt;/pre&gt;

That'll even cover bizarre variants such as &quot;RtMP&quot; and the like (not that that's especially likely).  And then, since the &quot;rtmpe&quot; and &quot;rtmps&quot; versions contain the pivotal string &quot;rtmp,&quot; it might be enough just to search for &quot;rtmp&quot; ... but like you said, this is already working for you, and I often find the adage &quot;if it ain't broke, don't fix it&quot; a good one.</description>
		<content:encoded><![CDATA[<p>Matt,</p>
<blockquote><p>I’m sure it can be done better but it works for me.</p></blockquote>
<p>I find that to be true of most of my work!  Sometimes it depends on deadlines, budget, a combination of those, or something else altogether.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>You might want to consider a tweak to this portion of your code:</p>
<pre><code>if (_vidURL.indexOf(
    &quot;rtmp://&quot; || &quot;RTMP://&quot; || &quot;RTMPE://&quot; ||
    &quot;RTMPS://&quot; || &quot;rtmpe://&quot; || &quot;rtmps://&quot;
  ) > -1) {</code></pre>
<p>&#8230; only because, if you really want to play it safe, you may want to account for variants besides all-lowercase or all-uppercase.  One trick I&#8217;ve seen pretty often is to use <code>String.toLowerCase()</code> in the comparison expression to evaluate the target string in all lowercase &#8230;</p>
<pre><code>if (_vidURL.toLowerCase().indexOf(
    &quot;rtmp://&quot; || &quot;rtmpe://&quot; || &quot;rtmps://&quot;
  ) > -1) {</code></pre>
<p>That&#8217;ll even cover bizarre variants such as &#8220;RtMP&#8221; and the like (not that that&#8217;s especially likely).  And then, since the &#8220;rtmpe&#8221; and &#8220;rtmps&#8221; versions contain the pivotal string &#8220;rtmp,&#8221; it might be enough just to search for &#8220;rtmp&#8221; &#8230; but like you said, this is already working for you, and I often find the adage &#8220;if it ain&#8217;t broke, don&#8217;t fix it&#8221; a good one.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Matt</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-246205</link>
		<pubDate>Mon, 11 Aug 2008 01:55:37 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-246205</guid>
					<description>Was easier then I thought... Thought I'd post my code. I'm sure it can be done better but it works for me. Just need to close the stream after playing now.

-------------------------

function loadURL():void {
		//trace(&quot;vidURL1: &quot; + _vidURL);	

		_appURL = _vidURL.substr(0 , (_vidURL.lastIndexOf(&quot;/&quot;) + 1));
		//trace(&quot;_appURL1: &quot; + _appURL);
				
		_lastSlash = _vidURL.lastIndexOf(&quot;/&quot;);
		//trace(&quot;_lastSlash1: &quot; + _lastSlash);

		_lastDot = _vidURL.lastIndexOf(&quot;.&quot;);
		//trace(&quot;_lastDot1: &quot; + _lastDot);

		_vidEXT = _vidURL.substr(_lastDot + 1);
		//trace(&quot;_vidEXT1: &quot; + _vidEXT);

		_vidFile = _vidURL.substr(_lastSlash + 1);
		//trace(&quot;_vidFile1: &quot; + _vidFile);
				

		if (_vidURL.indexOf(&quot;rtmp://&quot; &amp;#124;&amp;#124; &quot;RTMP://&quot; &amp;#124;&amp;#124; &quot;RTMPE://&quot; &amp;#124;&amp;#124; &quot;RTMPS://&quot; &amp;#124;&amp;#124; &quot;rtmpe://&quot; &amp;#124;&amp;#124; &quot;rtmps://&quot;) &amp;#62; -1) {
				
				trace(&quot;_appURL1a: &quot; + _appURL);
				//_debugField.appendText(&quot;RTMP URL Found &quot; + &quot; \n &quot;);
				
				conn.connect(_appURL);
				
				}
				
		else {

				conn.connect(null);
				//_debugField.appendText(&quot;HTTP URL Found &quot; + &quot; \n &quot;);
				}
				
				
	}
	
	function onBWDone():void{
		//trace(&quot;onBWDone: &quot;);
		//_debugField.appendText(&quot;onBWDone&quot; + &quot; \n &quot;);
		} 
		

	function streamRTMP():void {
		//trace(&quot;StreamRTMP: &quot; + _vidFile);
		//_debugField.appendText(&quot;StreamRTMP function: &quot; + &quot; \n &quot;);
			stream = new NetStream(conn);
			stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
			stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
        	stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
			stream.play(_vidFile);
			player();
		}
		
	function streamHTTP():void {
		//_debugField.appendText(&quot;streamHTTP function: &quot; + &quot; \n &quot;);
		//trace(&quot;StreamHTTP: &quot; + _vidURL);
			stream = new NetStream(conn);
			stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
			stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
        	stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
			stream.play(_vidURL);
			player();
		}

--------------------------</description>
		<content:encoded><![CDATA[<p>Was easier then I thought&#8230; Thought I&#8217;d post my code. I&#8217;m sure it can be done better but it works for me. Just need to close the stream after playing now.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>function loadURL():void {<br />
		//trace(&#8221;vidURL1: &#8221; + _vidURL);	</p>
<p>		_appURL = _vidURL.substr(0 , (_vidURL.lastIndexOf(&#8221;/&#8221;) + 1));<br />
		//trace(&#8221;_appURL1: &#8221; + _appURL);</p>
<p>		_lastSlash = _vidURL.lastIndexOf(&#8221;/&#8221;);<br />
		//trace(&#8221;_lastSlash1: &#8221; + _lastSlash);</p>
<p>		_lastDot = _vidURL.lastIndexOf(&#8221;.&#8221;);<br />
		//trace(&#8221;_lastDot1: &#8221; + _lastDot);</p>
<p>		_vidEXT = _vidURL.substr(_lastDot + 1);<br />
		//trace(&#8221;_vidEXT1: &#8221; + _vidEXT);</p>
<p>		_vidFile = _vidURL.substr(_lastSlash + 1);<br />
		//trace(&#8221;_vidFile1: &#8221; + _vidFile);</p>
<p>		if (_vidURL.indexOf(&#8221;rtmp://&#8221; || &#8220;RTMP://&#8221; || &#8220;RTMPE://&#8221; || &#8220;RTMPS://&#8221; || &#8220;rtmpe://&#8221; || &#8220;rtmps://&#8221;) &gt; -1) {</p>
<p>				trace(&#8221;_appURL1a: &#8221; + _appURL);<br />
				//_debugField.appendText(&#8221;RTMP URL Found &#8221; + &#8221; \n &#8220;);</p>
<p>				conn.connect(_appURL);</p>
<p>				}</p>
<p>		else {</p>
<p>				conn.connect(null);<br />
				//_debugField.appendText(&#8221;HTTP URL Found &#8221; + &#8221; \n &#8220;);<br />
				}</p>
<p>	}</p>
<p>	function onBWDone():void{<br />
		//trace(&#8221;onBWDone: &#8220;);<br />
		//_debugField.appendText(&#8221;onBWDone&#8221; + &#8221; \n &#8220;);<br />
		} </p>
<p>	function streamRTMP():void {<br />
		//trace(&#8221;StreamRTMP: &#8221; + _vidFile);<br />
		//_debugField.appendText(&#8221;StreamRTMP function: &#8221; + &#8221; \n &#8220;);<br />
			stream = new NetStream(conn);<br />
			stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);<br />
			stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);<br />
        	stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);<br />
			stream.play(_vidFile);<br />
			player();<br />
		}</p>
<p>	function streamHTTP():void {<br />
		//_debugField.appendText(&#8221;streamHTTP function: &#8221; + &#8221; \n &#8220;);<br />
		//trace(&#8221;StreamHTTP: &#8221; + _vidURL);<br />
			stream = new NetStream(conn);<br />
			stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);<br />
			stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);<br />
        	stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);<br />
			stream.play(_vidURL);<br />
			player();<br />
		}</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-245134</link>
		<pubDate>Sun, 10 Aug 2008 02:20:50 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-245134</guid>
					<description>Matt and Peter,

Rock on, guys!  Glad you're rolling now.  :)</description>
		<content:encoded><![CDATA[<p>Matt and Peter,</p>
<p>Rock on, guys!  Glad you&#8217;re rolling now.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Peter</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-244664</link>
		<pubDate>Sat, 09 Aug 2008 17:06:05 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-244664</guid>
					<description>Thank you so much David. That works wonderfully :)</description>
		<content:encoded><![CDATA[<p>Thank you so much David. That works wonderfully <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Matt</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-244285</link>
		<pubDate>Fri, 08 Aug 2008 16:19:59 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-244285</guid>
					<description>Thanks David! Really appreciate the help.
-Matt</description>
		<content:encoded><![CDATA[<p>Thanks David! Really appreciate the help.<br />
-Matt
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-243829</link>
		<pubDate>Fri, 08 Aug 2008 02:12:19 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-243829</guid>
					<description>Matt,

Sure thing.  :)  Unfortunately, AS2 doesn't support regex directly, but Pavils Jurjans' Flash 5/MX-era custom &lt;code&gt;RegExp&lt;/code&gt; class is terrific.  You'll find an AS2 port by Joey Lott on the same link:

&lt;a href=&quot;http://www.jurjans.lv/flash/RegExp.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.jurjans.lv/flash/RegExp.html&lt;/a&gt;

Fortunately, AS3 supports regex directly.  And fortunately again, you just don't need it here.

To rip the rest of the string, use the &lt;code&gt;String.substr()&lt;/code&gt; method.  It accepts two parameters, &lt;em&gt;begin&lt;/em&gt; and &lt;em&gt;end&lt;/em&gt;, and the second one is optional.  Since &amp;#34;rtmp://&amp;#34; contains seven characters, you'll pass in 7 as the only parameter, which basically means &quot;Start at character 7 and continue till you hit the end of the string.&quot;

e.g.
&lt;pre&gt;&lt;code&gt;var str:String = &quot;rtmp://rtmp.myserver.com/path/folder&quot;;

if (str.indexOf(&quot;rtmp://&quot;) &gt; -1) {
	trace(str.substr(7));
}&lt;/code&gt;&lt;/pre&gt;

The &lt;code&gt;if&lt;/code&gt; statement checks if &amp;#34;rtmp://&amp;#34; is present at all (the return value would be 0, because &amp;#34;rtmp://&amp;#34; is at the first character in the string, and 0 is bigger than -1) ... and if so, the &lt;code&gt;substr()&lt;/code&gt; method kicks out the remainder of that string.</description>
		<content:encoded><![CDATA[<p>Matt,</p>
<p>Sure thing.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Unfortunately, AS2 doesn&#8217;t support regex directly, but Pavils Jurjans&#8217; Flash 5/MX-era custom <code>RegExp</code> class is terrific.  You&#8217;ll find an AS2 port by Joey Lott on the same link:</p>
<p><a href="http://www.jurjans.lv/flash/RegExp.html" target="_blank" rel="nofollow"><a href='http://www.jurjans.lv/flash/RegExp.html' rel='nofollow'>http://www.jurjans.lv/flash/RegExp.html</a></a></p>
<p>Fortunately, AS3 supports regex directly.  And fortunately again, you just don&#8217;t need it here.</p>
<p>To rip the rest of the string, use the <code>String.substr()</code> method.  It accepts two parameters, <em>begin</em> and <em>end</em>, and the second one is optional.  Since &quot;rtmp://&quot; contains seven characters, you&#8217;ll pass in 7 as the only parameter, which basically means &#8220;Start at character 7 and continue till you hit the end of the string.&#8221;</p>
<p>e.g.</p>
<pre><code>var str:String = "rtmp://rtmp.myserver.com/path/folder";

if (str.indexOf("rtmp://") > -1) {
	trace(str.substr(7));
}</code></pre>
<p>The <code>if</code> statement checks if &quot;rtmp://&quot; is present at all (the return value would be 0, because &quot;rtmp://&quot; is at the first character in the string, and 0 is bigger than -1) &#8230; and if so, the <code>substr()</code> method kicks out the remainder of that string.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Matt</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-243655</link>
		<pubDate>Thu, 07 Aug 2008 22:24:04 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-243655</guid>
					<description>Thanks David... I thought I'd have to do some crazy ReEx thing. 
String.indexOf() could work...
Once I matched RTMP:// how would I find all the characters after the last &quot;/&quot;  ?
I want to isolate the filename and use that as the NetStream.Play
and the rest of the previous characters in the url string for the NetConnection.

I'm going to work on this tonight. I'll post back anything I find.
-Matt</description>
		<content:encoded><![CDATA[<p>Thanks David&#8230; I thought I&#8217;d have to do some crazy ReEx thing.<br />
String.indexOf() could work&#8230;<br />
Once I matched RTMP:// how would I find all the characters after the last &#8220;/&#8221;  ?<br />
I want to isolate the filename and use that as the NetStream.Play<br />
and the rest of the previous characters in the url string for the NetConnection.</p>
<p>I&#8217;m going to work on this tonight. I&#8217;ll post back anything I find.<br />
-Matt
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-242820</link>
		<pubDate>Thu, 07 Aug 2008 03:50:14 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-242820</guid>
					<description>&lt;strong&gt;&lt;/strong&gt;

&lt;strong&gt;To Michael J ...&lt;/strong&gt;

I have occasionally encountered the audio-only issue you mentioned, but sadly, nothing comes to mind as an immediate &quot;Ah, it's probably this&quot; solution.  If I remember right, I might have had to re-encode the FLV(s) in question, but I suspect that doesn't help you ... especially after such a long delay on my part.  Sorry!

As a matter of habit, when I run into seemingly inexplicable issues like this myself, I try to break it down into smaller, simpler parts.  For example, can you load a single FLV &amp;#8212; no arrays, no looping &amp;#8212; with the basic video-loading ActionScript?

&lt;pre&gt;&lt;code&gt;var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
videoPlayer.attachVideo(ns);
ns.play(&amp;#34;nameOfFile.flv&amp;#34;);&lt;/code&gt;&lt;/pre&gt;

If so, then add an &lt;code&gt;Array&lt;/code&gt; instance with only a single entry, and use that in place of the file's literal name:

&lt;pre&gt;&lt;code&gt;var videos:Array = new Array(&amp;#34;nameOfFile.flv&amp;#34;);
// . . .
ns.play(videos[0]);&lt;/code&gt;&lt;/pre&gt;

Then keep trying to re-build the rest of the code in steps.

&lt;strong&gt;To Tiemen ...&lt;/strong&gt;

Thanks for the note, buddy!  That may well be a reason to use the &lt;code&gt;if (evt.code == “NetStream.Play.Stop”) { ... }&lt;/code&gt; approach.

&lt;strong&gt;To Ruth ...&lt;/strong&gt;

I've responded to you via email to see if I can help you with that.

&lt;strong&gt;To Angie ...&lt;/strong&gt;

That's a really neat idea!  If I were going to encode a list like that, I would probably format it as XML.  That way, you could create as many categories as you please &amp;#8212; just create a &lt;code&gt;&amp;#60;category&amp;#62;&lt;/code&gt; tag, for example, and nest &lt;code&gt;&amp;#60;video&amp;#62;&lt;/code&gt; tags inside them.  Illustrating something like that would take some thought ... I'm not sure how familiar or comfortable you are with XML, but does that at least give you a place to start?

&lt;strong&gt;To Peter ...&lt;/strong&gt;

To loop your videos indefinitely, you could use an &lt;code&gt;if&lt;/code&gt; statement to reset the &lt;code&gt;currentVideo&lt;/code&gt; variable back to 0 when it gets to the end.  In fact, you could use the &lt;code&gt;if&lt;/code&gt; statement already in place in the &lt;code&gt;onStatus&lt;/code&gt; handler.  Note the difference here:

&lt;pre&gt;&lt;code&gt;ns.onStatus = function(evt:Object):Void {
  if (ready &amp;&amp; this.time &gt; 0 &amp;&amp; this.time &gt;= (duration - 0.5)) {
    ready = false;
    currentVideo++;
    if (currentVideo &gt;= videos.length) {
      currentVideo = 0;
    }
    ns.play(videos[currentVideo]);
  }
}&lt;/code&gt;&lt;/pre&gt;

&lt;strong&gt;To Matt ...&lt;/strong&gt;

I don't know RTMP as well as I'd like to (and probably not as well as I should), but for example ... assuming the RTMP feed always begins with the &lt;code&gt;rtmp://&lt;/code&gt; protocol, you could use, say, &lt;code&gt;String.indexOf()&lt;/code&gt; to check of the string &quot;rtmp://&quot; is present in the path.  If it is, it's a stream; if not, it's a progressive download.

Does that help?</description>
		<content:encoded><![CDATA[<p><strong></strong></p>
<p><strong>To Michael J &#8230;</strong></p>
<p>I have occasionally encountered the audio-only issue you mentioned, but sadly, nothing comes to mind as an immediate &#8220;Ah, it&#8217;s probably this&#8221; solution.  If I remember right, I might have had to re-encode the FLV(s) in question, but I suspect that doesn&#8217;t help you &#8230; especially after such a long delay on my part.  Sorry!</p>
<p>As a matter of habit, when I run into seemingly inexplicable issues like this myself, I try to break it down into smaller, simpler parts.  For example, can you load a single FLV &mdash; no arrays, no looping &mdash; with the basic video-loading ActionScript?</p>
<pre><code>var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
videoPlayer.attachVideo(ns);
ns.play(&quot;nameOfFile.flv&quot;);</code></pre>
<p>If so, then add an <code>Array</code> instance with only a single entry, and use that in place of the file&#8217;s literal name:</p>
<pre><code>var videos:Array = new Array(&quot;nameOfFile.flv&quot;);
// . . .
ns.play(videos[0]);</code></pre>
<p>Then keep trying to re-build the rest of the code in steps.</p>
<p><strong>To Tiemen &#8230;</strong></p>
<p>Thanks for the note, buddy!  That may well be a reason to use the <code>if (evt.code == “NetStream.Play.Stop”) { ... }</code> approach.</p>
<p><strong>To Ruth &#8230;</strong></p>
<p>I&#8217;ve responded to you via email to see if I can help you with that.</p>
<p><strong>To Angie &#8230;</strong></p>
<p>That&#8217;s a really neat idea!  If I were going to encode a list like that, I would probably format it as XML.  That way, you could create as many categories as you please &mdash; just create a <code>&lt;category&gt;</code> tag, for example, and nest <code>&lt;video&gt;</code> tags inside them.  Illustrating something like that would take some thought &#8230; I&#8217;m not sure how familiar or comfortable you are with XML, but does that at least give you a place to start?</p>
<p><strong>To Peter &#8230;</strong></p>
<p>To loop your videos indefinitely, you could use an <code>if</code> statement to reset the <code>currentVideo</code> variable back to 0 when it gets to the end.  In fact, you could use the <code>if</code> statement already in place in the <code>onStatus</code> handler.  Note the difference here:</p>
<pre><code>ns.onStatus = function(evt:Object):Void {
  if (ready &#038;&#038; this.time > 0 &#038;&#038; this.time >= (duration - 0.5)) {
    ready = false;
    currentVideo++;
    if (currentVideo >= videos.length) {
      currentVideo = 0;
    }
    ns.play(videos[currentVideo]);
  }
}</code></pre>
<p><strong>To Matt &#8230;</strong></p>
<p>I don&#8217;t know RTMP as well as I&#8217;d like to (and probably not as well as I should), but for example &#8230; assuming the RTMP feed always begins with the <code>rtmp://</code> protocol, you could use, say, <code>String.indexOf()</code> to check of the string &#8220;rtmp://&#8221; is present in the path.  If it is, it&#8217;s a stream; if not, it&#8217;s a progressive download.</p>
<p>Does that help?
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
