Permalink
Browse files

updated @addyosmani 's track element detection to reflect partial sup…

…port by IE10
  • Loading branch information...
aFarkas committed Aug 26, 2012
1 parent 7d87471 commit 2c8ddada33ca552eb3792616dfb9c38ab2a40246
Showing with 9 additions and 2 deletions.
  1. +9 −2 feature-detects/elem-track.js
@@ -1,4 +1,11 @@
-// Track element
+// Track element + Timed Text Track API
// http://www.w3.org/TR/html5/video.html#the-track-element
+// http://www.w3.org/TR/html5/media-elements.html#text-track-api
+//
+// While IE10 has implemented the track element, IE10 does not expose the underlying APIs to create timed text tracks by JS (really sad)
// By Addy Osmani
-Modernizr.addTest('track', (typeof (document.createElement('video').addTextTrack) === 'function'));
+Modernizr.addTest({
+ texttrackapi: (typeof (document.createElement('video').addTextTrack) === 'function'),
+ //a more strict test for track including UI support: document.createElement('track').kind === 'subtitles'
+ track: ('kind' in document.createElement('track'))
+});

1 comment on commit 2c8ddad

@addyosmani

This comment has been minimized.

Show comment
Hide comment
@addyosmani

addyosmani Aug 26, 2012

Contributor

Sweet! (btw, might want to add an extra space after // and before a just for comment consistency)

Contributor

addyosmani commented on 2c8ddad Aug 26, 2012

Sweet! (btw, might want to add an extra space after // and before a just for comment consistency)

Please sign in to comment.