HTML 5 Video Player Errors

ronbo613

Golden Member
Jan 9, 2010
1,237
45
91
I'm using Video.JS to embed .mp4 videos on my website; here's one of the video pages.
Everything seems to work fine on Chrome, Firefox and IE, but when I check the page with W3.org Unicorn check page, I get a lot of errors dealing with missing attributes, mostly in this video player section:

Code:
 <p align="center"><video id="WAW_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="360" poster="ColumbiaRiverSmallmouthBassFishing.jpg" data-setup='{&quot;WAW_option&quot;:true}'>
    <source src="ColumbiaRiverSmallmouthBassFishing.mp4" type='video/mp4' />
    <track kind="captions" src="captions.vtt" srclang="en" label="English" />
I'm not sure if I have messed up the video player coding or if mixing it up with the rest of the XHTML has caused problems, or what. I use Dreamweaver CS4 but it's kind of outdated, some of the code I do manually. Since everything seems to be working fine, I probably could just forget about it, but I want the coding to be error-free if possible.
 

KB

Diamond Member
Nov 8, 1999
5,401
386
126
Replace

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

with

Code:
<!doctype html>

The validator is probebly validating your code against HTML 4.0 and not 5.0.

Also with XHTML your controls attribute must be filled in so it would be controls="controls"
 

ronbo613

Golden Member
Jan 9, 2010
1,237
45
91
Thanks KB.
As you can most likely tell, I'm not an advanced programmer so I appreciate the advice.