1
동영상이 전체 화면에서 재생되고 사용자가 다른 동영상 위치로 이동하는 동안 찾기 및 찾기 이벤트를 검색하고 감지 할 수있는 방법이 있습니까?모바일 Safari HTML5 비디오 전체 화면 검색 및 검색 이벤트
바탕 화면에있는 사파리의 내장 된 비디오 태그에서 제대로 작동합니다. 감사!
동영상이 전체 화면에서 재생되고 사용자가 다른 동영상 위치로 이동하는 동안 찾기 및 찾기 이벤트를 검색하고 감지 할 수있는 방법이 있습니까?모바일 Safari HTML5 비디오 전체 화면 검색 및 검색 이벤트
바탕 화면에있는 사파리의 내장 된 비디오 태그에서 제대로 작동합니다. 감사!
작은 JS 코드 조각을 사용했습니다 : var lastTimePosition = 0;
$("video").on("timeupdate", function(){
//Time difference between last event handled and current position
var diff = Math.abs(this.currentTime - lastTimePosition);
//If difference more that 1 second, handle event (on iOS Safari this event handles 3 times per second. You can increase this parameter to be sure it will handle only on manual seeking
if (diff > 1) {
window.location = "video://currentTime:" + this.currentTime;
console.log("Time:" + this.currentTime);
}
lastTimePosition = this.currentTime;
});
이 JS 스 니펫을 UIWebView 또는 WKWebView에 추가하고 업데이트를 수신합니다. JS에서의 Obj-C의 콜백 볼 얻는 방법
있는 UIWebView : How to invoke Objective C method from Javascript and send back data to Javascript in iOS?
WKWebView : http://www.joshuakehn.com/2014/10/29/using-javascript-with-wkwebview-in-ios-8.html