Solved

Windows Media Player 9 Series Controls

Posted on 2003-11-04
7
3,569 Views
Last Modified: 2007-12-19
I am making a custom interface for of media player and embedding it on a webpage. In the OBJECT tag I am using CLASSID:="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" -- This ID is for Windows Media 9 Series. I have made custom controls to Play, Pause, and Stop the video.

The problem I am having are that:
1) I am not able to remove the original controls of the windows media player.
2) After clicking PAUSE button the video pauses BUT when I click Play again, the video starts from the beginning and NOT from the current location.
3) I have found some articles on the MSDN but I am not able to understand them as they are not explained with a nice expample.

You can check the page I have made from this site http://webdev.maxwell.syr.edu/skalra/custom_skin/test.htm also, please see the coding I have been doing from the View Source.

Please help me out.

Thanks.
0
Comment
Question by:shamitkalra
7 Comments
 
LVL 14

Expert Comment

by:spiderfix
Comment Utility
*.edu

When is the assignment due?
0
 

Accepted Solution

by:
gmeader earned 25 total points
Comment Utility
<HTML>
<HEAD></HEAD>
<BODY>
<SCRIPT LANGUAGE="JAVASCRIPT">
function StartPlay()
{
  if (mediaPlayer.controls.isAvailable('Play'))
  {
    mediaPlayer.controls.Play();
  }
}

function StopPlay()
{
  if (mediaPlayer.controls.isAvailable('Stop'))
  {
    mediaPlayer.controls.stop();
  }
}

function playerPause()
{
  if (mediaPlayer.controls.isAvailable('Pause'))
  {
     mediaPlayer.controls.pause();
  }
}

function Show()
{
mediaPlayer.showcontrols=true;
mediaPlayer.showTracker=true;
mediaPlayer.showStatusBar=true;
}

function Hide()
{
mediaPlayer.showcontrols=false;
mediaPlayer.showTracker=false;
mediaPlayer.showStatusBar=false;
}

function updateStatus()
{
statusField.value=mediaPlayer.Status;
position.value=mediaPlayer.controls.currentPositionString;
}
</SCRIPT>

<object ID="mediaPlayer" CLASSID="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
TYPE="application/x-oleobject"
WIDTH="320" HEIGHT="240">
<PARAM NAME="AutoStart" VALUE="true">
</object>
Using Windows Media Player 9 SDK API
  <br>
  <input name="URLfield" type="text" id="URLfield" value="http://bogus.com/ohyeah.wma" size="60">
</p>
<p>
  <input name="btnURL" type="button" value="send URL" OnClick="setURL()">
  <input name="btnPlay" type="button" value="Play" OnClick="StartPlay()">
  <input name="btnStop" type="button" value="Stop" OnClick="StopPlay()">
  <input name="btnShow" type="button" value="Show Controls" OnClick="Show()">
  <input name="btnHide" type="button" value="Hide Controls" OnClick="Hide()">
  <input name="btnPause" type="button" value="Pause" OnClick="playerPause()">
  Position:
  <input name="position" type="text" size="6">
  Duration:
  <input name="durationfield" type="text" size="8">  
<p>  status:
  <input name="statusField" type="text" id="statusField" size="40">
</p>


<script language="JavaScript" type="text/JavaScript">
// update fields every 1000 milliseconds (1 second)
  var timer = window.setInterval("updateStatus()",1000);
</script>

</SCRIPT>
<!-- Create an event handler to update the display when
 the current media item changes. -->
<SCRIPT LANGUAGE = "JavaScript"  FOR = mediaPlayer  EVENT = OpenStateChange(NewState)>

// Test whether the new media item is open.
if (NewState == 13){

   // Write the formatted duration string to a textfield.
   durationfield.value = mediaPlayer.currentMedia.durationString;
}
</SCRIPT>

0
 

Assisted Solution

by:sludgebob
sludgebob earned 25 total points
Comment Utility
0
 

Author Comment

by:shamitkalra
Comment Utility
Thanks for the response everyone. I figured out the solution myself. The final version of the custom interface is at this site http://webdev.maxwell.syr.edu/skalra/custom_skin/final/default.asp click Test Video link.

Thanks again.
0
 
LVL 11

Expert Comment

by:turn123
Comment Utility
Hello,

This question has been classified as abandoned.   I will make a recommendation to the moderators on its resolution in the next few days.

EXPERTS: Please make a recommendation on how you feel the question should be closed.  If you feel you deserve points here, but don't care to respond, the question might very well get DELETED.

ASKER:  Please return and finalize this question.  Abandoning a question is in violation of the member agreement.  If the asker does not know how to close the question, the options are here:
http://www.experts-exchange.com/help.jsp#hs5

Please do NOT accept this comment as an answer, as I am simply trying to alert those involved that the question is still open.

Thank you,

Turn123
EE Cleanup Volunteer
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Do you have the problem that a lot of tasks are stacking up fairly quickly? A good way to reduce your big task list is to apply the 3 minute rule. Its fairly simple: if someone asks you to do a specific task, and you know for a fact that it will …
Stuck in voice control mode on your Amazon Firestick?  Here is how to turn it off!!!
Notifications on Experts Exchange help you keep track of your activity and updates in one place. Watch this video to learn how to use them on the site to quickly access the content that matters to you.
Articles on a wide range of technology and professional topics are available on Experts Exchange. These resources are written by members, for members, and can be written about any topic you feel passionate about. Learn how to best write an article t…

772 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

10 Experts available now in Live!

Get 1:1 Help Now