ipa单独修改方法(2.2.8): 在 function onStop() { playbackManager.stop(self.currentPlayer) } 后, 加入 //0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 var my_touches_type = null; var my_touches_start = null; var my_touches_value = 0; var my_touches_nowvalue = 0; var my_touches_rate = null; var my_touches_time = null; function my_touches_func(e, v, t, x, s) { v = v > 0 ? v - 20 : v + 20; let step = (Math.abs(v) / (s ? x * 5 : x * 0.5)) * 100; step = v > 0 ? step : -step; v = s ? t + step : t - step; step = v > 100 ? 100 : v < 0 ? 0 : v; if (v > 100 || v < 0) { my_touches_start = e; my_touches_nowvalue = step; } return step; } _dom.default.addEventListener(view, "touchstart", function (e) { if (shouldOsdBeShown(self) && !self.currentVisibleMenu && self.currentLockState === 0) { my_touches_type = null; my_touches_start = e.touches[0]; my_touches_value = 0; my_touches_time = setTimeout(() => { if (my_touches_type === null) { my_touches_rate = _playbackmanager.default.getPlaybackRate( self.currentPlayer ); _playbackmanager.default.setPlaybackRate( my_touches_rate * 2, self.currentPlayer ); } }, 1500); } else { my_touches_start = null; my_touches_rate = null; } }), _dom.default.addEventListener(view, "touchmove", function (e) { if (my_touches_start != null && my_touches_rate === null) { let x = e.touches[0].pageX - my_touches_start.pageX; let y = e.touches[0].pageY - my_touches_start.pageY; if (my_touches_type === null && Math.abs(x) > 20 || my_touches_type === "play") { my_touches_type = "play"; my_touches_value = my_touches_func(e.touches[0], x, nowPlayingSliderValue, screen.width, true); self.nowPlayingPositionSlider.beginEditing(my_touches_value); } } }), _dom.default.addEventListener(view, "touchend", function (e) { if (my_touches_start && (my_touches_value !== 0 || my_touches_type != null)) { if (my_touches_type === "play") { nowPlayingSliderValue = my_touches_value; self.nowPlayingPositionSlider.setValue(my_touches_value); clearEndEditTimeoutForPositionSlider(); endEditTimeoutForPositionSlider = endEditsForPositionSlider(); } my_touches_start = null; my_touches_type = null; self.hideOsd(); } if (my_touches_time != null) { clearTimeout(my_touches_time); my_touches_time = null; } if (my_touches_rate != null) { _playbackmanager.default.setPlaybackRate( my_touches_rate, self.currentPlayer ); my_touches_rate = null; } }), //0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ipa单独修改方法(2.2.7): 在 function onStop() { playbackManager.stop(self.currentPlayer) } 后, 加入 //0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 var my_touches_type = null; var my_touches_start = null; var my_touches_value = 0; var my_touches_nowvalue = 0; var my_touches_rate = null; var my_touches_time = null; function my_touches_func(e, v, t, x, s) { v = v > 0 ? v - 20 : v + 20; let step = (Math.abs(v) / (s ? x * 5 : x * 0.5)) * 100; step = v > 0 ? step : -step; v = s ? t + step : t - step; step = v > 100 ? 100 : v < 0 ? 0 : v; if (v > 100 || v < 0) { my_touches_start = e; my_touches_nowvalue = step; } return step; } dom.addEventListener(view, "touchstart", function (e) { if (shouldOsdBeShown(self) && !self.currentVisibleMenu && self.currentLockState === 0) { my_touches_type = null; my_touches_start = e.touches[0]; my_touches_value = 0; my_touches_time = setTimeout(() => { if (my_touches_type === null) { my_touches_rate = playbackManager.getPlaybackRate( self.currentPlayer ); playbackManager.setPlaybackRate( my_touches_rate * 2, self.currentPlayer ); } }, 1500); } else { my_touches_start = null; my_touches_rate = null; } }), dom.addEventListener(view, "touchmove", function (e) { if (my_touches_start != null && my_touches_rate === null) { let x = e.touches[0].pageX - my_touches_start.pageX; let y = e.touches[0].pageY - my_touches_start.pageY; if (my_touches_type === null && Math.abs(x) > 20 || my_touches_type === "play") { my_touches_type = "play"; my_touches_value = my_touches_func(e.touches[0], x, nowPlayingSliderValue, screen.width, true); self.nowPlayingPositionSlider.beginEditing(my_touches_value); } } }),dom.addEventListener(view, "touchend", function (e) { if (my_touches_start && (my_touches_value !== 0 || my_touches_type != null)) { if (my_touches_type === "play") { nowPlayingSliderValue = my_touches_value; self.nowPlayingPositionSlider.setValue(my_touches_value); clearEndEditTimeoutForPositionSlider(); endEditTimeoutForPositionSlider = endEditsForPositionSlider(); } my_touches_start = null; my_touches_type = null; self.hideOsd(); } if (my_touches_time != null) { clearTimeout(my_touches_time); my_touches_time = null; } if (my_touches_rate != null) { playbackManager.setPlaybackRate( my_touches_rate, self.currentPlayer ); my_touches_rate = null; } }), /*0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*/ 安卓, web 修改方法 <手势, 前进后退, 左侧上下音量, 右侧上下亮度, 长按加速> 搜索 function onStop() 在_dom.那一行前面加入以下代码 var my_touches_type = null; var my_touches_start = null; var my_touches_value = 0; var my_touches_nowvalue = 0; var my_touches_rate = null; var my_touches_time = null; function my_touches_func(e, v, t, x, s) { v = v > 0 ? v - 20 : v + 20; let step = (Math.abs(v) / (s ? x * 5 : x * 0.5)) * 100; step = v > 0 ? step : -step; v = s ? t + step : t - step; step = v > 100 ? 100 : v < 0 ? 0 : v; if (v > 100 || v < 0) { my_touches_start = e; my_touches_nowvalue = step; } return step; } _dom.default.addEventListener(view, "touchstart", function (e) { if (shouldOsdBeShown(self) && !self.currentVisibleMenu && self.currentLockState === 0) { my_touches_type = null; my_touches_start = e.touches[0]; my_touches_value = 0; my_touches_time = setTimeout(() => { if (my_touches_type === null) { my_touches_rate = _playbackmanager.default.getPlaybackRate( self.currentPlayer ); _playbackmanager.default.setPlaybackRate( my_touches_rate * 2, self.currentPlayer ); } }, 1500); } else { my_touches_start = null; my_touches_rate = null; } }), _dom.default.addEventListener(view, "touchmove", function (e) { if (my_touches_start != null && my_touches_rate === null) { let x = e.touches[0].pageX - my_touches_start.pageX; let y = e.touches[0].pageY - my_touches_start.pageY; if (my_touches_type === null && Math.abs(x) > 20 || my_touches_type === "play") { my_touches_type = "play"; my_touches_value = my_touches_func(e.touches[0], x, nowPlayingSliderValue, screen.width, true); self.nowPlayingPositionSlider.beginEditing(my_touches_value); } else if (Math.abs(y) > 20) { if (my_touches_type === null && my_touches_start.pageX <= screen.width / 2 || my_touches_type === "volume") { if (my_touches_type === null) { my_touches_type = "volume"; my_touches_nowvalue = _playbackmanager.default.getVolume(self.currentPlayer); videoOsdVolumeControls.classList.add("videoOsdVolumeControls-showhover"); videoOsdVolumeControls.classList.remove("videoOsdVolumeControls-hidetouch", "hide"); videoOsdVolumeControls.style.setProperty("display", "flex", "important"); videoOsdVolumeSliderWrapper.style.setProperty("display", "flex", "important"); } my_touches_value = Math.floor(my_touches_func(e.touches[0], y, my_touches_nowvalue, screen.height, false)); if (_playbackmanager.default.getVolume(self.currentPlayer) != my_touches_value) { nowPlayingVolumeSlider.setValue(my_touches_value); _playbackmanager.default.setVolume( my_touches_value, self.currentPlayer ) } self.showOsd(); } else if (my_touches_type === null && my_touches_start.pageX > screen.width / 2 || my_touches_type === "bright") { if (my_touches_type === null) { my_touches_type = "bright"; my_touches_nowvalue = _playbackmanager.default.getBrightness(self.currentPlayer); brightnessSliderContainer.classList.remove("hide"); brightnessSliderContainer.style.setProperty("display", "flex", "important"); } my_touches_value = Math.floor(my_touches_func(e.touches[0], y, my_touches_nowvalue, screen.height, false)); if (_playbackmanager.default.getBrightness(self.currentPlayer) != my_touches_value) { brightnessSlider.setValue(my_touches_value); _playbackmanager.default.setBrightness( my_touches_value, self.currentPlayer ); } self.showOsd(); } } } }), _dom.default.addEventListener(view, "touchend", function (e) { if (my_touches_start && (my_touches_value !== 0 || my_touches_type != null)) { if (my_touches_type === "play") { nowPlayingSliderValue = my_touches_value; self.nowPlayingPositionSlider.setValue(my_touches_value); clearEndEditTimeoutForPositionSlider(); endEditTimeoutForPositionSlider = endEditsForPositionSlider(); } else if (my_touches_type === "volume") { videoOsdVolumeControls.classList.add("videoOsdVolumeControls-hidetouch", "hide"); videoOsdVolumeControls.style.setProperty("display", "none", "important"); videoOsdVolumeSliderWrapper.style.setProperty("display", "none", "important"); } else if (my_touches_type === "bright") { brightnessSliderContainer.style.setProperty("display", "none", "important"); } my_touches_start = null; my_touches_type = null; self.hideOsd(); } if (my_touches_time != null) { clearTimeout(my_touches_time); my_touches_time = null; } if (my_touches_rate != null) { _playbackmanager.default.setPlaybackRate( my_touches_rate, self.currentPlayer ); my_touches_rate = null; } }),