diff --git a/common/media.js b/common/media.js index f2dc8612660495..800593f5343ad6 100644 --- a/common/media.js +++ b/common/media.js @@ -9,10 +9,15 @@ function getVideoURI(base) var videotag = document.createElement("video"); - if ( videotag.canPlayType && - videotag.canPlayType('video/ogg; codecs="theora, vorbis"') ) + if ( videotag.canPlayType ) { - extension = '.ogv'; + if (videotag.canPlayType('video/webm; codecs="vp9, opus"') ) + { + extension = '.webm'; + } else if ( videotag.canPlayType('video/ogg; codecs="theora, vorbis"') ) + { + extension = '.ogv'; + } } return base + extension; @@ -46,10 +51,11 @@ function getAudioURI(base) function getMediaContentType(url) { var extension = new URL(url, location).pathname.split(".").pop(); var map = { - "mp4": "video/mp4", - "ogv": "application/ogg", - "mp3": "audio/mp3", - "oga": "application/ogg", + "mp4" : "video/mp4", + "ogv" : "application/ogg", + "webm": "video/webm", + "mp3" : "audio/mp3", + "oga" : "application/ogg", }; return map[extension]; } diff --git a/fetch/api/request/destination/resources/dummy_video.webm b/fetch/api/request/destination/resources/dummy_video.webm new file mode 100644 index 00000000000000..c3d433a3e02e86 Binary files /dev/null and b/fetch/api/request/destination/resources/dummy_video.webm differ diff --git a/images/pattern.webm b/images/pattern.webm new file mode 100644 index 00000000000000..7cd3d31155723f Binary files /dev/null and b/images/pattern.webm differ diff --git a/media/2x2-green.webm b/media/2x2-green.webm new file mode 100644 index 00000000000000..0fbb250d398fdf Binary files /dev/null and b/media/2x2-green.webm differ diff --git a/media/A4.webm b/media/A4.webm new file mode 100644 index 00000000000000..b4adbec02b5442 Binary files /dev/null and b/media/A4.webm differ diff --git a/media/counting.webm b/media/counting.webm new file mode 100644 index 00000000000000..56d1f1c8acb2c5 Binary files /dev/null and b/media/counting.webm differ diff --git a/media/green-at-15.webm b/media/green-at-15.webm new file mode 100644 index 00000000000000..023a96bf645b48 Binary files /dev/null and b/media/green-at-15.webm differ diff --git a/media/movie_300.webm b/media/movie_300.webm new file mode 100644 index 00000000000000..bb7edf20d483b1 Binary files /dev/null and b/media/movie_300.webm differ diff --git a/media/movie_5.webm b/media/movie_5.webm new file mode 100644 index 00000000000000..9ae12e84ea5874 Binary files /dev/null and b/media/movie_5.webm differ diff --git a/media/test.webm b/media/test.webm new file mode 100644 index 00000000000000..5794667d09910c Binary files /dev/null and b/media/test.webm differ diff --git a/media/video.webm b/media/video.webm new file mode 100644 index 00000000000000..0783123f4ef633 Binary files /dev/null and b/media/video.webm differ