Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Media Player: Detecting end of film for multiple film ASX

Posted on 2004-09-09
4
Medium Priority
?
551 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 500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

688 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