@@ -125,15 +125,18 @@ function renderMedia (state) {
|
||||
}
|
||||
|
||||
function onCanPlay (e) {
|
||||
var video = e.target
|
||||
if (video.webkitVideoDecodedByteCount > 0 &&
|
||||
video.webkitAudioDecodedByteCount === 0) {
|
||||
var elem = e.target
|
||||
if (state.playing.type === 'video') {
|
||||
if (elem.webkitVideoDecodedByteCount === 0) {
|
||||
dispatch('mediaError', 'Video codec unsupported')
|
||||
} else if (elem.webkitAudioDecodedByteCount === 0) {
|
||||
dispatch('mediaError', 'Audio codec unsupported')
|
||||
}
|
||||
} else if (state.playing.type === 'audio' &&
|
||||
elem.webkitAudioDecodedByteCount === 0) {
|
||||
dispatch('mediaError', 'Audio codec unsupported')
|
||||
} else if (state.playing.type === 'video' &&
|
||||
video.webkitVideoDecodedByteCount === 0) {
|
||||
dispatch('mediaError', 'Video codec unsupported')
|
||||
} else {
|
||||
video.play()
|
||||
elem.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user