Cleanup unsupported codec detection (pt 2) (#570)

This commit is contained in:
Feross Aboukhadijeh
2016-05-23 22:03:38 -07:00
committed by DC
parent 30e81c7699
commit 1b49c6568b

View File

@@ -132,15 +132,10 @@ function renderMedia (state) {
function onCanPlay (e) { function onCanPlay (e) {
var elem = e.target var elem = e.target
if (state.playing.type === 'video') { if (state.playing.type === 'video' && elem.webkitVideoDecodedByteCount === 0) {
if (elem.webkitVideoDecodedByteCount === 0) {
dispatch('mediaError', 'Video codec unsupported') dispatch('mediaError', 'Video codec unsupported')
} else if (elem.webkitAudioDecodedByteCount === 0) { } else if (elem.webkitAudioDecodedByteCount === 0) {
dispatch('mediaError', 'Audio codec unsupported') dispatch('mediaError', 'Audio codec unsupported')
}
} else if (state.playing.type === 'audio' &&
elem.webkitAudioDecodedByteCount === 0) {
dispatch('mediaError', 'Audio codec unsupported')
} else { } else {
elem.play() elem.play()
} }