Solved

Media Player: Detecting end of film for multiple film ASX

Posted on 2004-09-09
4
549 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

627 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