Results 1 to 13 of 13

Thread: how do people do this?

  1. #1

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    how do people do this?

    hi, i have a website and i would like to create a webpage that would have a costum parameter for a control like windows media player control inside a webpage and i can change the url of it by going to a url like http://somesite/costumpage.htm?wmurl=/music.wma
    and it would play music.wma without the path being coded into the page.
    i seen this done on sites like launch.yahoo.com
    how can i do this myself and what language is it done in.
    thanks, dandono
    ps. i dont have a clue about this and am asking this question to save a lot of time from making every page by making one.
    If there is only one perfect person in the universe, does that make them imperfect?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: how do people do this?

    Most likely, using HTML and javascript.

    Embed the Windows Media Player object onto your page, and using javascript or vbscript, set the .URL property to the value specified in the querystring.

  3. #3

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: how do people do this?

    yeah but how can i do that?
    If there is only one perfect person in the universe, does that make them imperfect?

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

  5. #5

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: how do people do this?

    i know how to embed controls into webpages but how can i make it change the url to what ever is after the "?wmpurl=" tag in the url?
    If there is only one perfect person in the universe, does that make them imperfect?

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: how do people do this?

    Did you see the VBScript on that page?

  7. #7

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: how do people do this?

    you can't view the source code for the launch.yahoo player
    If there is only one perfect person in the universe, does that make them imperfect?

  8. #8
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602

    Re: how do people do this?

    HTML Code:
    <html>
    <head>
    <title>Music Player</title>
    
    <script type = "text/javascript">
    function playSong(strURL){
    Player.url = strURL;
    }
    
    function stopSong(){
    Player.controls.stop();
    }
    </script>
    
    </head>
    
    <body>
    <object id="Player" width="0" height="0"
    classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
    </object>
    
    <form id = "frmPlayer">
    <input type = "text" id = "txtURL" />
    <input type = "button" id = "cmdPlay" value = "Play" onclick = "playSong(txtURL.value);"/>
    <input type = "button" id = "cmdStop" value = "Stop" onclick = "stopSong();" />
    </form>
    
    </body>
    </html>
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

  9. #9

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: how do people do this?

    i cant get your code to work.
    If there is only one perfect person in the universe, does that make them imperfect?

  10. #10
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: how do people do this?

    A little elaboration on that would be helpful.

  11. #11
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602

    Re: how do people do this?

    It won't run in Firefox/Mozilla and IE with XP2 will block the Active X file.
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

  12. #12

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: how do people do this?

    what i mean is to have a webpage that looks the same on every file and the path of it tells it what file to play. i do not want the user to be able to change the path. i am learning php so can this be done in php?
    something like http://www.dws05.ath.cx/somepage.php...=/somefile.wma
    ps. move this thread if you want to the php forum but i only just started to learn php.
    If there is only one perfect person in the universe, does that make them imperfect?

  13. #13

    Thread Starter
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: how do people do this?

    i have learnt most of php and i have made my own little script in php.
    it is two files. one is a html form and the other is a dynamic php file.
    this is the html file:
    HTML Code:
    <html>
    
    <head>
    <title>Dan's Web Server 2005!</title>
    
    </head>
    
    <body>
    <form action="mp.php" method="POST">
    <input type="text" name="name" />
    <input type="submit" />
    </form>
    </body>
    </html>
    this is the php file:
    PHP Code:
    <?
    $URL = $_POST["name"];
    print 
    '<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Dans Web Server 2005!</title>
    </head>

    <body>
    <p>
    <object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="WindowsMediaPlayer1" width="245" height="240">
      <param name="URL" value=' . $URL . '>
      <param name="rate" value="1">
      <param name="balance" value="0">
      <param name="currentPosition" value="0">
      <param name="defaultFrame" value>
      <param name="playCount" value="1">
      <param name="autoStart" value="-1">
      <param name="currentMarker" value="0">
      <param name="invokeURLs" value="-1">
      <param name="baseURL" value>
      <param name="volume" value="50">
      <param name="mute" value="0">
      <param name="uiMode" value="full">
      <param name="stretchToFit" value="0">
      <param name="windowlessVideo" value="0">
      <param name="enabled" value="-1">
      <param name="enableContextMenu" value="-1">
      <param name="fullScreen" value="0">
      <param name="SAMIStyle" value>
      <param name="SAMILang" value>
      <param name="SAMIFilename" value>
      <param name="captioningID" value>
      <param name="enableErrorDialogs" value="0">
      <param name="_cx" value="6482">
      <param name="_cy" value="6350">
    </object>
    </p>
    <p>You are now playing ' . $URL . '.<br>You are connected to Dans Web Server 2005! on the host name <a href="http://'. $_SERVER['HTTP_HOST'] . '">' . $_SERVER['HTTP_HOST'] . '</a> ' . '</p>
    </body>

    </html>'
    ?>
    the code seems to work fine on my server (http://www.dwsn.ath.cx/dev/mp.php)
    Last edited by dandono; Nov 22nd, 2005 at 05:10 AM.
    If there is only one perfect person in the universe, does that make them imperfect?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width