diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-10-15 09:45:50 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-10-15 09:45:50 +0000 |
commit | e15dd966d523731101f70ccf768bba12435a0208 (patch) | |
tree | ae9cb828a24ded2585a41af3f21411523b47897d /Tools/TestWebKitAPI/Tests/WebKit2/file-with-mse.html | |
download | WebKitGtk-tarball-e15dd966d523731101f70ccf768bba12435a0208.tar.gz |
webkitgtk-2.10.2webkitgtk-2.10.2
Diffstat (limited to 'Tools/TestWebKitAPI/Tests/WebKit2/file-with-mse.html')
-rw-r--r-- | Tools/TestWebKitAPI/Tests/WebKit2/file-with-mse.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/file-with-mse.html b/Tools/TestWebKitAPI/Tests/WebKit2/file-with-mse.html new file mode 100644 index 000000000..413eed6e8 --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/WebKit2/file-with-mse.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html> +<head> + <script> + var source; + var request; + + function playVideo() + { + request = new XMLHttpRequest(); + request.responseType = 'arraybuffer'; + request.open('GET', 'test-mse.mp4', true); + request.addEventListener('load', load); + request.send(); + } + + function load(event) + { + source = new MediaSource(); + source.addEventListener('sourceopen', sourceopen); + var video = document.getElementById('test-video'); + video.src = URL.createObjectURL(source); + } + + function sourceopen(event) + { + var sourceBuffer = source.addSourceBuffer('video/mp4;codecs="avc1.4D4001,mp4a.40.2"'); + sourceBuffer.appendBuffer(request.response); + sourceBuffer.addEventListener('updateend', updateend); + } + + function updateend(event) + { + document.getElementById('test-video').play(); + } + </script> +</head> +<body> + <p> + <video id="test-video" controls></video> + </p> + <p> + <button onclick="playVideo()">Play video</button> + </p> +</body> +</html> |