Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 552
  • Last Modified:

Media Player: Detecting end of film for multiple film ASX

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
Smoerble
Asked:
Smoerble
  • 2
  • 2
1 Solution
 
benbalboCommented:
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
 
SmoerbleAuthor Commented:
Yes that would be easier but it is variable.
0
 
benbalboCommented:
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
 
SmoerbleAuthor Commented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now