Solved

Media Player: Detecting end of film for multiple film ASX

Posted on 2004-09-09
4
546 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
Comment Utility
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
Comment Utility
Yes that would be easier but it is variable.
0
 
LVL 2

Accepted Solution

by:
benbalbo earned 250 total points
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now