?
Solved

Embedded Windows Media Player Time Control

Posted on 2005-02-28
4
Medium Priority
?
629 Views
Last Modified: 2012-06-21
Dear Experts,

Is there a way to control (or limit) play time of an mp3 song using embedded Windows Media Player on a web site?
I would like to play a demo portion of about 30 seconds instead of the whole music on a web site using a Windows Media Player, but don't want to create a separate 30 second demo file.
Is there a way to limit the playing time of the embedded Windows Media Player?

Thanks, in advance.
0
Comment
Question by:matthewyea
[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
4 Comments
 
LVL 5

Expert Comment

by:aspmaestro
ID: 13427320
checkout this PAQ:
http://www.experts-exchange.com/Web/Q_20691473.html

you can call the settimeout function in javascript with interval set to 30 secs. once the playing has started call settimeout keeping check on counter; if it reaches 30 then stop playing the file.
0
 
LVL 5

Expert Comment

by:aspmaestro
ID: 13427325
check this url source for getting acquainted with settimeout :
http://www.geocities.com/mangokun/programming/javascript/control_setTimeout.htm

0
 
LVL 10

Accepted Solution

by:
eeBlueShadow earned 500 total points
ID: 13429316
JavaScript is not the best way to go about this. There are specially designed playlist files (ASX) to help you here.

http://msdn.microsoft.com/library/en-us/wcewmt/html/_wcesdk_asx_asx_elements_reference.asp

For example, copy the following text to a file, give it a .asx extension and open it in Media Player

<ASX>
  <ENTRY>
    <DURATION VALUE="00:00:10" />
    <REF HREF="http://blueshadow.no-ip.com/ee/bennyhill.mp3"></REF>
  </ENTRY>
</ASX>

However, since you a) aren't creating a separate file for your 'demo' and b) need to send the player the URL of the full file, it's possible for someone to catch the URL of the file and simply download the whole thing. There's no way getting around that, unfortunately

_Blue
0
 

Author Comment

by:matthewyea
ID: 13434435
Thanks, aspmaestro and eeBlueShadow.
I've created a script and it worked great.  Thanks again.  ^^
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Suggested Courses

770 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