

































<?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 Determine the Completion of a Flash Video (FLV) File (AS2)</title>
	<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Wed, 08 Feb 2012 15:22:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Supriya Tenany</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-554213</link>
		<pubDate>Thu, 18 Aug 2011 06:22:34 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-554213</guid>
					<description>Hi,

I have problem in streaming FLV over an HTTP protocol, with fluctuating bandwidth. When an another application sharing the bandwidth is opened/closed, the flash player experiences sudden Play.Stop event for the FLV. The player uses a netstream class and its objects and events. I could only find a timeout specification for FMS server, but nothing for Apache, from where my media content is delivered to clients. What could be the reason for this unexpected Play.Stop event?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have problem in streaming FLV over an HTTP protocol, with fluctuating bandwidth. When an another application sharing the bandwidth is opened/closed, the flash player experiences sudden Play.Stop event for the FLV. The player uses a netstream class and its objects and events. I could only find a timeout specification for FMS server, but nothing for Apache, from where my media content is delivered to clients. What could be the reason for this unexpected Play.Stop event?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Greg</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-430291</link>
		<pubDate>Mon, 14 Dec 2009 16:21:52 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-430291</guid>
					<description>David,
Just wanted to say thanks! This was a quick and easy help.</description>
		<content:encoded><![CDATA[<p>David,<br />
Just wanted to say thanks! This was a quick and easy help.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: sandrar</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-412028</link>
		<pubDate>Thu, 10 Sep 2009 13:51:35 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-412028</guid>
					<description>Hi! I was surfing and found your blog post... nice! I love your blog.  :) Cheers! Sandra. R.</description>
		<content:encoded><![CDATA[<p>Hi! I was surfing and found your blog post&#8230; nice! I love your blog.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Cheers! Sandra. R.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Janis Gonser</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-361468</link>
		<pubDate>Wed, 11 Mar 2009 15:08:12 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-361468</guid>
					<description>Hello David,
thank you very much for this, especially for me as a beginner. I looked through various post and found that its possible to add a time marker.

// Load the video
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
videoPlayer.attachVideo(ns);
ns.play(&quot;externalVideo.flv&quot;);
// Monitor the video
this.onEnterFrame = function() {
  if (ns.time &amp;#62;= 25) {
    trace(&quot;Video is finished!&quot;);
    delete this.onEnterFrame;
  }
}

So I am using this and now would like to make the video simply loop, but can't figure out how. Also, is there a more simple way to make the video loop without having the identifying length, maybe just a parameter 

thanks alot.
-Janis</description>
		<content:encoded><![CDATA[<p>Hello David,<br />
thank you very much for this, especially for me as a beginner. I looked through various post and found that its possible to add a time marker.</p>
<p>// Load the video<br />
var nc:NetConnection = new NetConnection();<br />
nc.connect(null);<br />
var ns:NetStream = new NetStream(nc);<br />
videoPlayer.attachVideo(ns);<br />
ns.play(&#8221;externalVideo.flv&#8221;);<br />
// Monitor the video<br />
this.onEnterFrame = function() {<br />
  if (ns.time &gt;= 25) {<br />
    trace(&#8221;Video is finished!&#8221;);<br />
    delete this.onEnterFrame;<br />
  }<br />
}</p>
<p>So I am using this and now would like to make the video simply loop, but can&#8217;t figure out how. Also, is there a more simple way to make the video loop without having the identifying length, maybe just a parameter </p>
<p>thanks alot.<br />
-Janis
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jetty</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-286730</link>
		<pubDate>Wed, 08 Oct 2008 10:46:45 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-286730</guid>
					<description>Hi david,
I just want to get video complete message for a embedded video in a time line OR the meachanisim we need to use for getting the video playback complete message 
Pls send the code to my e-mail</description>
		<content:encoded><![CDATA[<p>Hi david,<br />
I just want to get video complete message for a embedded video in a time line OR the meachanisim we need to use for getting the video playback complete message<br />
Pls send the code to my e-mail
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Artur Trzebunia</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-249878</link>
		<pubDate>Mon, 18 Aug 2008 19:02:26 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-249878</guid>
					<description>David,

Thank you for pointing me to your blog site.  I've read the tutorials on working with cue points in Flash and understand this topic so much better.  I finally understand how Flash recognizes cue points with specific names.

I also understand your tutorial on how to determine when video reaches completion using onMetadata and onStatus.  Taking this a step forward, how do I tell the video to return to the beginning AND STOP once the video reaches the end or the stop button is pressed?  I've tried using ns.seek(0), but this statement returns the video to the beginning and starts playing again.

Thanks for all your help.</description>
		<content:encoded><![CDATA[<p>David,</p>
<p>Thank you for pointing me to your blog site.  I&#8217;ve read the tutorials on working with cue points in Flash and understand this topic so much better.  I finally understand how Flash recognizes cue points with specific names.</p>
<p>I also understand your tutorial on how to determine when video reaches completion using onMetadata and onStatus.  Taking this a step forward, how do I tell the video to return to the beginning AND STOP once the video reaches the end or the stop button is pressed?  I&#8217;ve tried using ns.seek(0), but this statement returns the video to the beginning and starts playing again.</p>
<p>Thanks for all your help.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: professional</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-224822</link>
		<pubDate>Sun, 20 Jul 2008 02:51:35 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-224822</guid>
					<description>Hello. I think you are eactly thinking like Sukrat. I really loved the post.</description>
		<content:encoded><![CDATA[<p>Hello. I think you are eactly thinking like Sukrat. I really loved the post.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Nicholas</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-194796</link>
		<pubDate>Wed, 04 Jun 2008 23:49:28 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-194796</guid>
					<description>OK David,

I completely understand now. Except, if &quot;video4.flv&quot; is missing from the directory the videoPlayer continues to buffer. Rather than skip to the first video and start over.
The videoPlayer works and skips to the next .flv file, it is only when the last .flv is missing that it does not skip to the first .flv and start over.

Thank you very much for contribution thus far!
Nick.</description>
		<content:encoded><![CDATA[<p>OK David,</p>
<p>I completely understand now. Except, if &#8220;video4.flv&#8221; is missing from the directory the videoPlayer continues to buffer. Rather than skip to the first video and start over.<br />
The videoPlayer works and skips to the next .flv file, it is only when the last .flv is missing that it does not skip to the first .flv and start over.</p>
<p>Thank you very much for contribution thus far!<br />
Nick.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-194637</link>
		<pubDate>Wed, 04 Jun 2008 17:20:10 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-194637</guid>
					<description>Nicholas,

In the code you pasted, you already have a &lt;code&gt;complete&lt;/code&gt; handler present:

&lt;pre&gt;&lt;code&gt;listenerObject.complete = function(eventObject:Object):Void {
  currentlyPlaying++;
  if (currentlyPlaying &gt;= videoList.length) {
    currentlyPlaying = 0;
  }
  trace(currentlyPlaying);
  videoPlayer.contentPath = videoList[currentlyPlaying];
  videoPlayer.play();
};&lt;/code&gt;&lt;/pre&gt;

That event handler references &lt;code&gt;currentlyPlaying&lt;/code&gt; and &lt;code&gt;contentPath&lt;/code&gt;, and I'm proposing that you add a second event handler that does the same thing for a video that fails to load.  Your second event handler would presumably do the same thing &amp;#8212; to an extent.  The &lt;code&gt;stateChange&lt;/code&gt; event handler should probably &lt;em&gt;not&lt;/em&gt; loop &lt;code&gt;currentlyPlaying&lt;/code&gt; to the beginning again, because that loop would repeat forever in the off-chance that none of the video files are present.

So ... you'll continue to have your &lt;code&gt;complete&lt;/code&gt; handler, but you'll also add a &lt;code&gt;stateChange&lt;/code&gt; handler:

&lt;pre&gt;&lt;code&gt;listenerObject.complete = function(eventObject:Object):Void {
  currentlyPlaying++;
  if (currentlyPlaying &gt;= videoList.length) {
    currentlyPlaying = 0;
  }
  trace(currentlyPlaying);
  videoPlayer.contentPath = videoList[currentlyPlaying];
  videoPlayer.play();
};
listenerObject.stateChange = function(eventObject:Object):Void {
  if (eventObject.state == &amp;#34;connectionError&amp;#34;) {
    currentlyPlaying++;
    if (currentlyPlaying &lt; videoList.length) {
      videoPlayer.contentPath = videoList[currentlyPlaying];
      videoPlayer.play();
    }
  }
};
videoPlayer.addEventListener(&amp;#34;complete&amp;#34;, listenerObject);
videoPlayer.addEventListener(&amp;#34;stateChange&amp;#34;, listenerObject);&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Nicholas,</p>
<p>In the code you pasted, you already have a <code>complete</code> handler present:</p>
<pre><code>listenerObject.complete = function(eventObject:Object):Void {
  currentlyPlaying++;
  if (currentlyPlaying >= videoList.length) {
    currentlyPlaying = 0;
  }
  trace(currentlyPlaying);
  videoPlayer.contentPath = videoList[currentlyPlaying];
  videoPlayer.play();
};</code></pre>
<p>That event handler references <code>currentlyPlaying</code> and <code>contentPath</code>, and I&#8217;m proposing that you add a second event handler that does the same thing for a video that fails to load.  Your second event handler would presumably do the same thing &mdash; to an extent.  The <code>stateChange</code> event handler should probably <em>not</em> loop <code>currentlyPlaying</code> to the beginning again, because that loop would repeat forever in the off-chance that none of the video files are present.</p>
<p>So &#8230; you&#8217;ll continue to have your <code>complete</code> handler, but you&#8217;ll also add a <code>stateChange</code> handler:</p>
<pre><code>listenerObject.complete = function(eventObject:Object):Void {
  currentlyPlaying++;
  if (currentlyPlaying >= videoList.length) {
    currentlyPlaying = 0;
  }
  trace(currentlyPlaying);
  videoPlayer.contentPath = videoList[currentlyPlaying];
  videoPlayer.play();
};
listenerObject.stateChange = function(eventObject:Object):Void {
  if (eventObject.state == &quot;connectionError&quot;) {
    currentlyPlaying++;
    if (currentlyPlaying < videoList.length) {
      videoPlayer.contentPath = videoList[currentlyPlaying];
      videoPlayer.play();
    }
  }
};
videoPlayer.addEventListener(&quot;complete&quot;, listenerObject);
videoPlayer.addEventListener(&quot;stateChange&quot;, listenerObject);</code></pre>
]]></content:encoded>
				</item>
	<item>
		<title>by: Nicholas</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-194499</link>
		<pubDate>Wed, 04 Jun 2008 09:23:28 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv#comment-194499</guid>
					<description>Hi Dave,

Thank you very much! ;)

Although, as good as you are at Flash I am unfortunately not.
With the above ActionScript you gave me, Do I replace the old script or simlply add it?

In regards to the updating of the currentlyPlaying and contentPath, I dont quite understand...

By any chance are your two books based on Flash? Because I would realy love to have a copy of my own!! Hope all goes well.

Thanks, Nick</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>Thank you very much! <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Although, as good as you are at Flash I am unfortunately not.<br />
With the above ActionScript you gave me, Do I replace the old script or simlply add it?</p>
<p>In regards to the updating of the currentlyPlaying and contentPath, I dont quite understand&#8230;</p>
<p>By any chance are your two books based on Flash? Because I would realy love to have a copy of my own!! Hope all goes well.</p>
<p>Thanks, Nick
</p>
]]></content:encoded>
				</item>
</channel>
</rss>

