www.webdeveloper.com
Results 1 to 2 of 2

Thread: Video won't play in IE?

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Posts
    13

    Video won't play in IE?

    I'm 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:
    Code:
      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:
    Code:
    <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!

  2. #2
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    With Flash you need to embed a .swf to play the .flv. The .flv will not play directly in the browser.
    So:
    Code:
    assets/company_reel/company_reel.flv
    should instead point to a .swf video player, not the .flv itself.
    Best wishes,
    Eye for Video

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles