Embedded Windows Media Player Time Control

Posted on 2005-02-28
Medium Priority
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.
Question by:matthewyea
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

Expert Comment

ID: 13427320
checkout this PAQ:

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.

Expert Comment

ID: 13427325
check this url source for getting acquainted with settimeout :

LVL 10

Accepted Solution

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.


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

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

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


Author Comment

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

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