chrome.It에서 HTML5 오디오 플레이어를 실행하는 데 문제가 있습니다. IE 9 이상 및 Firefox에서 제대로 작동합니다. 내가 전달 및 F7에 오디오 플레이어를 되 감는 자바 스크립트 함수를 & F8 키 언론, IE와 FF에서 그 woring 괜찮아요하지만 몇 가지 이유로 Chrome에서 작동하지 않습니다. 다음은 코드입니다.HTML5의 오디오 플레이어가 크롬에서 제대로 작동하지 않습니다 (앞으로 감기 및 되감기 재생)
$(document).keydown(function (e) {
if (e.keyCode == 118) { rewindAudio(); return false; }
else if (e.keyCode == 119) { forwardAudio(); return false; }
}
// Rewinds the audio file by 30 seconds.
function rewindAudio() {
// Check for audio element support.
if (window.HTMLAudioElement)
{
try {
var oAudio = audioPlayerInFocus[0];
oAudio.currentTime -= 1.0;
}
catch (e) {
// Fail silently but show in F12 developer tools console
if (window.console && console.error("Error:" + e));
}
}
}
// Fast forwards the audio file by 1 seconds.
function forwardAudio() {
// Check for audio element support.
if (window.HTMLAudioElement) {
try {
var oAudio = audioPlayerInFocus[0
oAudio.currentTime += 1.0;
}
catch (e) {
// Fail silently but show in F12 developer tools console
if (window.console && console.error("Error:" + e));
}
}
}
은 내가 currentTime을이 구문의 실수 나 브라우저 관련 문제에 chrome.Is에서 변경되지 않은 의심? 고마워, 도와주세요.
'var oAudio = audioPlayerInFocus [0'은 구문 오류입니다. 또한, 'audioPlayerInFocus'가 무엇인지 알려주세요 – blint