Solved

Media Player: Detecting end of film for multiple film ASX

Posted on 2004-09-09
4
547 Views
Last Modified: 2008-02-01
I am using an embedded Windows Media Player. The film called is an ASX file that specify a series of streams to load after one another. I would like to detect the end of the *last* stream. The Player.playState returns "MediaEnded" after each stream but I want an event only after the last. Clues anyone? Thank you very much!
0
Comment
Question by:Smoerble
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:benbalbo
ID: 12023877
If the page always knows how many streams are going to be played, you could use a counter to count the number of "MediaEnded"s you get.
0
 

Author Comment

by:Smoerble
ID: 12024792
Yes that would be easier but it is variable.
0
 
LVL 2

Accepted Solution

by:
benbalbo earned 250 total points
ID: 12037165
But is it a variable that can be predicted? What I'm trying to ask is, can you figure out how many streams will be played? If the user selects them, you could count the number of selections. If the script is generated server side (ASP/PHP/Perl...) then you can insert the number into the javascript using the serverside script...

If there is absolutely no way of determining how many streams there are, then your only hope is finding a return state similar to "MediaEnded" but instead indicating that all streams have ended. Of course, then Windows Media Player would need to know how many streams there are :-)

Can I ask how you define the streams? How you pass them to WMP?
0
 

Author Comment

by:Smoerble
ID: 12041865
Problem was solved by triggering a setTimeout("checkPlayerState()",10) timer when I receive a media ended event. If I after 10 ms still get a "media ended" status, I know it was the last stream, otherwise I get status "buffering".
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

821 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