track.js 1.0 KB

1234567891011121314151617181920212223
  1. /*!
  2. {
  3. "name": "Track element and Timed Text Track",
  4. "property": ["texttrackapi", "track"],
  5. "tags": ["elem"],
  6. "builderAliases": ["elem_track"],
  7. "authors": ["Addy Osmani"],
  8. "notes": [{
  9. "name": "W3C Spec (Track Element)",
  10. "href": "https://web.archive.org/web/20121119095019/http://www.w3.org/TR/html5/the-track-element.html#the-track-element"
  11. },{
  12. "name": "W3C Spec (Track API)",
  13. "href": "https://web.archive.org/web/20121119094620/http://www.w3.org/TR/html5/media-elements.html#text-track-api"
  14. }],
  15. "warnings": ["While IE10 has implemented the track element, IE10 does not expose the underlying APIs to create timed text tracks by JS (really sad)"]
  16. }
  17. !*/
  18. define(['Modernizr', 'createElement'], function(Modernizr, createElement) {
  19. Modernizr.addTest('texttrackapi', typeof (createElement('video').addTextTrack) === 'function');
  20. // a more strict test for track including UI support: document.createElement('track').kind === 'subtitles'
  21. Modernizr.addTest('track', 'kind' in createElement('track'));
  22. });