홈>
iOS 및 Android 장치에서 비디오를 재생할 수 없습니다. Safari 원격 디버깅을 사용할 때 다음과 같은 문제가 발생합니다.
Unhandled Promise Rejection: AbortError: The operation was aborted.
내 HTML 코드
<video id="video" class="absolute right-0 bottom-0 min-w-full min-h-full w-auto" controls autoplay>
<source src="/path/to/video.mp4" type="video/mp4">
<!-- the absolute path doesn't work too -->
<source src="https://example.com/path/to/video.mp4" type="video/mp4">
</video>
<!-- this code doesn't work too -->
<video id="video" src="/path/to/video.mp4" type="video/mp4" class="absolute right-0 bottom-0 min-w-full min-h-full w-auto" controls autoplay></video>
내 JS 코드
let video = document.getElementbyId('video');
const videoPromise = document.querySelector('video').play();
let video_cta = document.getElementbyId('video_cta');
//this doesn't fix my problem
if (videoPromise !== undefined) {
videoPromise.then(_ => {
video.play();
})
.catch(error => {
console.log(error);
})
}
//this code doesn't work too:
function fetchVideoAndPlay() {
fetch('https://example.com/file.mp4')
.then(response => response.blob())
.then(blob => {
video.srcObject = blob;
return video.play();
})
.then(_ => {
// Video playback started ;)
})
.catch(e => {
// Video playback failed ;(
})
}
//start video after click the button
video_cta.addEventListener('click' function() {
video.play()
})
요약 : 상대 또는 절대 경로를 사용하든 iOS 및 Android 기기의 모바일 브라우저 (Chrome, Safari)에서만 작동하지 않습니다.
- 답변 # 1
관련 자료
- reactjs - React Functional 컴포넌트 html5 비디오 플레이어 캡처 이벤트
- Android Studio 41 일부 중단 점이 트리거되지 않음
- ionic framework - Android appflow 배포는 장치를 업데이트하지 않습니다
- javascript - ReactJs 시간 비디오 html5 변경
- shopify - 하단 HTML5 비디오 자르기
- python - 지원되는 모든 캡에서 비디오 캡처가 작동하지 않습니다
- java - Android 앱을 시작할 때 GIF가 표시되지 않습니다
- Android WorkManager는 두 명의 예약 된 작업자 중 하나를 트리거하지 않습니다
- Android의 webrtc 화상 통화에서 비디오 품질을 낮추고 높이는 방법
- Android 4에서는 작동하지만 Android 9에서는 작동하지 않는 URL의 비디오
- gradle - 인공물 발행은 안드로이드 스튜디오 341에서 작동하지 않습니다
- Android Quickblox 화상 통화 스피커가 자동으로 켜져 있지 않습니다
- html - http 버전에서 비디오 태그 html5가 작동하지 않습니다
- java - Android Foreground Service onStartCommand가 호출되지 않고 onCreate 만 호출됩니다
- javascript - 반응에서 비디오 내부에 (html5 캔버스를 사용하여) 그리고 싶습니다
- html - 자막이있는 html5 동영상을 올바르게 게시하는 방법 [seo]
- java - Android 스튜디오 stringisBlank ()가 존재하지 않습니다
- 함수가 문서에 있지만 Android Studio는 NotificationCompatBuildersetSilent (Boolean)를 인식하지 못합니다
- java - android - 동영상 활동에서 방향을 자동으로 변경하는 방법은 무엇입니까?
- HTML & JavaScript - html 및 javascript - html5 동영상 음소거를 해제 할 수 없습니다
재생 버튼을 눌렀을 때 비디오를 자동 재생하려고합니까? 아니면 오류가 발생합니까?
동영상을 자동 재생하려는 경우 자동 재생시 동영상에서 소리가 나는 경우 더 이상 브라우저를 허용하지 않습니다. 오디오를 비활성화 한 다음 비디오를 자동 재생하는 것이 가능합니다.