Jump to content

Video not playing in older IE


Ty44ler

Recommended Posts

Trying to get some videos to play on my site, but they don't work on older IE browsers. I think it has something to do with HTML5 that's in there, but the backup flash file isn't being played either so I'm not sure.

 

Here's my PHP:

  private function createVideoHTML($intVersion) {
  
    $strHTML = "";
    
    if (is_int($intVersion)) {
            
      if ($intVersion >= 0 && $intVersion < $this->intImageCount ) {
  
        $intWidth      = $this->arrVersions[$intVersion]["width"];
        $intHeight     = $this->arrVersions[$intVersion]["height"];
        $strFlashSrc = $this->arrVersions[$intVersion]["flash_src"];
  
        $strHTML = "      <video width=\"$intWidth\" height=\"$intHeight\" controls>\n";
                
        foreach($this->arrVersions[$intVersion]["video_array"] as $intKey => $strVideo) {
      
          $strSrc    = $strVideo["src"];
          $strType   = $strVideo["type"];
          $strCodecs = $strVideo["codecs"];
      
          $strHTML .= "        <source src=\"$strSrc\" type=\"$strType\" codecs=\"$strCodecs\">\n"; 
      
        }

        if (strlen($strFlashSrc) > 0) {
          $strHTML .= $this->createFlashHTML($strFlashSrc, $intVersion);
        }       
  
        $strHTML .= "      </video>\n\n";
      }
    }
   
    return $strHTML;
    
  }

 

Outputted HTML:

<div id="video"> 

      <video width="640" height="360" controls> 
        <source src="assets/company_reel/company_reel.iphone.mp4" type="video/mp4" codecs="avc1.42E01E, mp4a.40.2"> 
        <source src="assets/company_reel/company_reel.webm" type="video/webm" codecs="vp8, vorbis"> 
        <source src="assets/company_reel/company_reel.theora.ogv" type="video/ogg" codecs="theora, vorbis"> 
<object width="320" height="240" type="application/x-shockwave-flash"  data="assets/company_reel/company_reel.flv"> 
    <param name="movie" value="assets/company_reel/company_reel.flv" /> 
    <param name="allowfullscreen" value="true" /> 
  </object>      </video> 

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/243932-video-not-playing-in-older-ie/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.