Help - Search - Members - Calendar
Full Version: Netscape/Mozala vs Explorer
Invision Power Services > Community Forums > Community Web Design and Coding
RedBora
I wan't to show movies, which basically works on Explorer, Netscape and Mozila... However, when I create a php function that shows the movie, then things go wrong...

I have spend the entire afternoon on it and I realy don't understand what's happening...

When I call this function (ShowMediaPlayer.php) like this:

<a href="ShowMediaPlayerv.php?video=videos/holidaymovie.wmv">Mediaplayer test</a>

The movie is correctly displayed on explorer, but the movie isn't even loaded on the other two browsers. When I ask for the movie properties in Mozilla I get this for the file location:
http://www.myweb.com/myweb/portal/ShowMedi...olidaymovie.wmv

you see what I mean ...its not the path to the movie...its the call to the mediaplayer function with the parameter...(ShowMediaPlayerv.php?video=videos/videos/holidaymovie.wmv)

When I open the same page in explorer it works fine and when I look at the file location properties from mediaplayer it says: http://www.myweb.com/myweb/portal/videos/holidaymovie.wmv

When I look at the html source code in the browser, explorer resolves the full url http://www.myweb.com/myweb/portal/videos/holidaymovie.wmv to the image while mozila/netscaoe only shows src=videos/holidaymovie.wmv

I don't understand this, and what to do about it?

PS: It's not in the <embed> or <object> tags, because when I use them directly in html, with a patf/video defined as a constant it works on all browsers.
Tseia
Please post the source of the PHP file - I think I can see what the problem is but I'll need the source code original.gif
RedBora
The php function below, is called from a htm document like this:
<a href="ShowMediaPlayer.php?gMovie=videos/mymovie.wmv"><img src="videos/mymovie.jpg" width="120" border="0"></a>

Remarks:
The code below works at this moment for all browsers, because I made a change to it. The size parameters for the movie arn't used yet.

Originally the variable 'gMovie'/'MovieName' was passed directly to the player. Now I create the full http path to the movie and now it works, but I still don't understand what I am doing wrong or why Netscape/Mozila behaves differently?

QUOTE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="expires" content="Sat, 1 Jan 2005 00:00:00 GMT">
<title></title>
<link href="../Templates/portalmainwin.css" rel="stylesheet" type="text/css">
</head>
<?php
/*******************************************************************************
REDS Mediaplayer player
File:   ShowMediaPlayer.php
Purpose: Show specified movie, using specified size.
Version: v1.0.0
Date:  12-Mar'2005

Remarks:
- There is a clumsy thing in this code.

*******************************************************************************/

// Get the name and (relative) path from the movie
$MovieName = $_GET['gMovie'];
$MovieHeight = $_GET['gMovieHeight'];
$MovieWidth = $_GET['gMovieWidth'];


// Get the hostname, and the path to current location
$temp = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
// Create a full http path to the movie, this is only needed for Netscape and Mozila browsers !?
$url=rtrim($temp, basename($temp));
$HttpMoviePath = 'http://'.$url.$MovieName;


print("
<body>
<table align='center'>
  <tr>
  <td>
   <OBJECT ID='MediaPlayer1' width=500 height=500
     classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95'
     codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902'
     standby='Loading Microsoft Windows Media Player components...'
     type='application/x-oleobject'>
    <PARAM NAME='FileName' VALUE='$HttpMoviePath'>
    <PARAM NAME='animationatStart' VALUE='true'>
    <PARAM NAME='transparentatStart' VALUE='true'>
    <PARAM NAME='autoStart' VALUE='true'>
    <PARAM NAME='showControls' VALUE='true'>
    <EMBED type='application/x-mplayer2' pluginspage = 'http://www.microsoft.com/Windows/MediaPlayer/'
     SRC='$HttpMoviePath'
     name='MediaPlayer1'
     width=500 height=500 AutoStart=true>
    </EMBED>
   </OBJECT>
   </td>
  </tr>
</Table>
</body>
</html>");
?>


....and offcourse any advice on improving this code is welcome, since I am a webdummy blink.gif
Tseia
Hmm. That's probably the best way of doing it (creating the full URL) though I can't see without testing it myself why it'd not work outside of IE. Experience has taught me that it's usually IE that does something wrong and allows incorrect code to work (which then breaks on Mozilla) - I don't know what the problem in this case is though.

As for any hints, I'd standardise capitalisation in your tags - make them all lower case, but don't mix upper case and lower case. It just makes it look nicer. Plus you could wrap the movie in a <div> and not a <table>, then give the <div> a class (class="movie" or something) and centre the movie in the CSS ( .movie { margin: 0px auto; }).
RedBora
The strange thing is that in all three browsers, the path value for the video variable is passed corectly (which is logical becaus its server side) but the strange thing is that media player creates the wrong http path under Netscape/Mozila...

But as far as i can see the code above works now.


uppercase lowercase....yeah I am bit confused....some use:
formcontact.php, others form_contact.php and again others use something like FormContact.php.... sad.gif

...but pure lowercase, maybe is less confusing...
Tseia
I personally like variables_and_filenames_with_underscores rather than CapitalLetters but it's up to the individual original.gif
Brendon Koz
"lowercase" is more standards compliant and will almost always easily transfer from server to server flawlessly (Windows' Servers are not case-sensitive for filenames, most *nix servers are configured to be case sensitive).


- edit -
I meant to say for filenames, not necessarily the code itself. wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.