SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    integrating windows media

    I posted this over in multimedia since I'm dealing with Windows MEdia, but then I realized just now that the reason why I have gone all day with barely any help is becasue it should be here, in client side scripting. So here goes.

    This is what I have.

    This is a test document located at http://www.t-w-o.org/test.php. It works just fine.


    Code:
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    <OBJECT ID="Player" height="0" width="0"
      CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
    </OBJECT>
    <INPUT TYPE="BUTTON" NAME="BtnPlay" VALUE="Play" OnClick="StartMeUp()">
    <INPUT TYPE="BUTTON" NAME="BtnStop" VALUE="Stop" OnClick="ShutMeDown()">
    <SCRIPT type="text/javascript">
    <!--
    
    function StartMeUp ()
    {
        Player.URL = "http://www.t-w-o.org/inclusions/canada.wma";
    }
    
    function ShutMeDown ()
    {
        Player.controls.stop();
    }
    
    -->
    </SCRIPT>
    </BODY>
    </HTML>

    But when I cut and paste the exact code, exactly as is in this document at http://www.t-w-o.org/trips-alt.php?id=1. I am boldfacing that section, then it doesn't work.

    PHP Code:
    <?PHP
               
    if (isset($HTTP_GET_VARS['id']) ==  false// check if id has been set
    {
    echo 
    "<p>You must select a location</p>"// if not, display this error
    exit;
    } else {
    $id $HTTP_GET_VARS['id'];
    if (
    is_numeric($id) == false)
    {
    echo 
    "You must select a valid location.";
    } else {
    MYSQL_CONNECT("localhost""******""******"); // connect to MySQL server
    MYSQL_SELECT_DB("******"); // select the database(db) where the info is stored
    $query MYSQL_QUERY("SELECT * FROM locations WHERE locationid = '$id'"); // query your table for a match with $locationid
    if (MYSQL_NUM_ROWS($query) == "1"// if a record is found, show the info
    {
    $fetch MYSQL_FETCH_ARRAY($query); // set $fetch to have the values from the table




    ?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> 


    <html>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <!-- #BeginEditable "doctitle" --> 
    <!--#include virtual="../inclusions/meta.ssi" -->
    <title>T.W.O. - <?PHP echo $fetch['trip']; ?></TITLE>
    <!-- #EndEditable --><script>
    <!--
    function StartMeUp ()
    {
        Player.URL = "<?php echo"http://www.t-w-o.org/".$fetch['music_url'].".wma"?>";
    }


    function ShutMeDown ()
    {
        Player.controls.stop();
    }


    <!--
    <!--
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    // -->
    </script>
    <link rel="stylesheet" href="inclusions/twostyles.css" type="text/css">
    <LINK REL="stylesheet" HREF="inclusions/twostyles.css" TYPE="TEXT/CSS">
    </HEAD>
    <BODY class="three">

    <DIV ID="Layer1" STYLE="position:absolute; width:175px; height:150px; z-index:5; left: 558px; top: 201px"> 
      <?
    echo"<img src=\"http://www.t-w-o.org/beta/images/".$fetch['map_url'].".gif\" align=\"right\">"


    ?>
      <DIV ALIGN="LEFT"></DIV>
    </DIV>
    <TABLE class="one" WIDTH=760 BORDER=0 CELLPADDING=0 CELLSPACING=0>
      <TR> 
        <TD COLSPAN=2 height="122"> <IMG SRC="images/images/two-gui_01.jpg" WIDTH=760 HEIGHT=125 ALT=""></TD>
      </TR>
      <TR> 
        <TD> <IMG SRC="images/images/two-gui_02.jpg" WIDTH=134 HEIGHT=455 ALT=""></TD>
        <TD> 
          <div id="homemenu" style="position:absolute; width:101px; height:318px; z-index:1; left: 14px; top: 167px"> 
            <p>&nbsp;</p>
            <p><a href="home.htm">Home</a></p>
            <p><a href="about.htm">About Us</a></p>
            <p><a href="2002trips.htm" target="frame-target" FRAME-TARGET="_self">2002 Expeditions</a></p>
            <p><a href="staff.htm">T.W.O. Staff</a></p>
            <p><a href="vision.htm">Our Vision</a></p>
            <p><a href="beliefs.htm">Our Beliefs</a></p>
            <p><a href="security.htm">Trip Security</a></p>
            <p><a href="eligib.htm">Eligibility</a></p>
            <p><a href="cost.htm">Trip Costs</a></p>
            <p><a href="training.htm">Training Week</a></p>
            <p><a href="testimonies.htm">Testimonies</a></p>
            <p><a href="applic.htm">Application</a></p>
            <p><a href="contact.htm">Contact Us</a></p>
            <p><a href="calendar.htm">Calendar</a></p>
          </div>
          <div id="bodytext" style="position:absolute; width:537px; height:421px; z-index:2; left: 152px; top: 156px"> 
            <h1> </h1>
            <P> 
              <?PHP
    echo "<h1 align=\"center\">";
    echo 
    $fetch['trip'];
    echo 
    "</h1>";


    echo
    "<table width=\"75%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";


    echo
    "<tr>";
    echo
    "<td><p style=\"color: #CC3300;\">" $fetch['length'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['description'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p style=\"font-size: larger;\"><b>Location</b></p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['location'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p style=\"font-size: larger;\"><b>Host</b></p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['host'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p style=\"font-size: larger;\"><b>Travel</b></p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['travel'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p style=\"font-size: larger;\"><b>Project</b></p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['project'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p style=\"font-size: larger;\"><b>Ministry</b></p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['ministry'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p style=\"font-size: larger;\"><b>Housing</b></p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['Housing'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p style=\"font-size: larger;\"><b>Climate</b></p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['Climate'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p style=\"font-size: larger;\"><b>Language</b></p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['Language'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p style=\"font-size: larger;\"><b>Age Restrictions</b></p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['agerestrictions'] . "</p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p style=\"font-size: larger;\"><b>Cost</b></p></td>";
    echo
    "</tr>";


    echo
    "<tr>";
    echo
    "<td><p>" $fetch['cost'] . "</p></td>";
    echo
    "</tr>";


    echo
    "</table>";
    } else {
    echo 
    "No match in database found."// if no match is found, display this error
    }
    }
    }
    ?>
            </P>
            <DIV ALIGN="CENTER"><img src="images/two-bullet.gif" width="20" height="27" alt=""> 
            </DIV>
            <div align="center"> 
              <pre>&copy;2001 Teen World Outreach. All Rights Reserved.</pre>
              <pre>Web Development by <a href="http://www.livingpages.net" target="_blank">Living Pages Information Services</a>.</pre>
            </div>
          </div>
          <div id="searchmenu" style="position:absolute; width:87px; height:101px; z-index:3; left: 635px; top: 26px"> 
            <pre><a href="home.htm">Home</a>


    <a   href="search.htm">Search</a>


    <a   href="contact.htm">Contact</a></pre>
          </div>
          <!-- ImageReady Slices (two-gui.jpg) -->
          <div id="one" style="position:absolute; width:2px; height:966px; z-index:4; left: 760px; top: 0px; background-color: #CCCCCC; layer-background-color: #CCCCCC"></div>
        </TD>
      </TR>
    </TABLE>
    <div id="two" style="position:absolute; width:2px; height:407px; z-index:4; left: 131px; top: 560px; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000"></div>
    <!-- End ImageReady Slices -->
    <div class="playstop" style="position:absolute; width:131px; height:20px; z-index:6; left: 0px; top: 557px" id="playstop"> 
      <form name="form1" method="post" action="">
        <div align="center">
    <OBJECT ID="Player" height="0" width="0"
      CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
    </OBJECT>
    <INPUT TYPE="BUTTON" NAME="BtnPlay" VALUE="Play" OnClick="StartMeUp()">
    <INPUT TYPE="BUTTON" NAME="BtnStop" VALUE="Stop" OnClick="ShutMeDown()">
    <SCRIPT type="text/javascript">
    <!--

    function StartMeUp ()
    {
        Player.URL = "http://www.t-w-o.org/inclusions/canada.wma";
    }

    function ShutMeDown ()
    {
        Player.controls.stop();
    }

    -->
    </SCRIPT>

        </div>
      </form>
    </div>
      </BODY>
    </HTML>
    There's got to be some javascripters out there to help me debug this.

    Sketch
    Aaron Brazell
    Technosailor



  2. #2
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Replace the following code:
    Code:
    <SCRIPT type="text/javascript">
    <!--
    
    function StartMeUp ()
    {
        Player.URL = "http://www.t-w-o.org/inclusions/canada.wma";
    }
    
    function ShutMeDown ()
    {
        Player.controls.stop();
    }
    
    -->
    </SCRIPT>
    Because of you've got it inside a form you may need to tell the script where to find the WMP Object
    With this code:
    Code:
    <SCRIPT type="text/javascript">
    <!--
    
    function StartMeUp ()
    {
        document.Player.URL = "http://www.t-w-o.org/inclusions/canada.wma";
    }
    
    function ShutMeDown ()
    {
        document.Player.controls.stop();
    }
    
    -->
    </SCRIPT>
    Even though you have given it an ID the Script does not know where to look for the WMP controller.

    for netscape you may also have to add...
    Code:
    document.form[0].
    this 0 inside [] represent the form number.. if you more than one form then see wich form the control is in... and replace it with correct number. the [0] is the first form, next is [1]

    before:
    Code:
    Player.URL
    and
    Code:
    Player.Controls

    Hope that helps.

  3. #3
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Making the DOM objects document.Player.controls and document.Player.URL doesn't work. If it's the form that's causing the problem, is there a method that would allow me to use buttons such as I am using without the Form tags?

    Sketch

    ***EDIT***

    I tried this without the <form> tags as well and it is still not working. Any other ideas?
    Last edited by Sketch; Nov 15, 2001 at 08:32.
    Aaron Brazell
    Technosailor




Bookmarks

Posting Permissions

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