Add skip intro button
No fucking clue whether this works, can't even test it...
This commit is contained in:
parent
9d4c561fbb
commit
b7b94ab432
@ -1482,6 +1482,10 @@ define(
|
|||||||
player = player || this._currentPlayer;
|
player = player || this._currentPlayer;
|
||||||
var offsetTicks = 1e4 * _usersettings.default.skipForwardLength();
|
var offsetTicks = 1e4 * _usersettings.default.skipForwardLength();
|
||||||
this.seekRelative(offsetTicks, player)
|
this.seekRelative(offsetTicks, player)
|
||||||
|
}, PlaybackManager.prototype.fastForwardSkipIntro = function (player) {
|
||||||
|
player = player || this._currentPlayer;
|
||||||
|
var offsetTicks = 1e4 * 9e4;
|
||||||
|
this.seekRelative(offsetTicks, player)
|
||||||
}, PlaybackManager.prototype.rewind = function (player) {
|
}, PlaybackManager.prototype.rewind = function (player) {
|
||||||
player = player || this._currentPlayer;
|
player = player || this._currentPlayer;
|
||||||
var offsetTicks = 0 - 1e4 * _usersettings.default.skipBackLength();
|
var offsetTicks = 0 - 1e4 * _usersettings.default.skipBackLength();
|
||||||
|
|||||||
14
videoosd/thingy.txt
Normal file
14
videoosd/thingy.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Button class is defined in videoosd.html
|
||||||
|
Button class is queried for in videoosd.js - view.querySelectorAll(".btnOsdFastForward")
|
||||||
|
Event listener is added to all found dom elements - onFastForwardButtonClick = fastForward(self, !0);
|
||||||
|
|
||||||
|
function fastForward(instance, animate) {
|
||||||
|
var player = instance.currentPlayer;
|
||||||
|
animate &&
|
||||||
|
(((animate = instance.view.querySelector(
|
||||||
|
".osd-ff-animationtext",
|
||||||
|
)).innerHTML =
|
||||||
|
"+" + parseInt(_usersettings.default.skipForwardLength() / 1e3)),
|
||||||
|
fadeInAndOut(animate)),
|
||||||
|
_playbackmanager.default.fastForward(player);
|
||||||
|
}
|
||||||
@ -163,6 +163,10 @@
|
|||||||
<button is="paper-icon-button-light" class="osdIconButton btnOsdFastForward hide" title="${FastForward}" aria-label="${FastForward}">
|
<button is="paper-icon-button-light" class="osdIconButton btnOsdFastForward hide" title="${FastForward}" aria-label="${FastForward}">
|
||||||
<i class="md-icon osdIconButton-icon btnOsdFastForwardIcon"></i>
|
<i class="md-icon osdIconButton-icon btnOsdFastForwardIcon"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button is="paper-icon-button-light" class="osdIconButton btnOsdFastForwardSkipIntro hide" title="${FastForward}" aria-label="${FastForward}">
|
||||||
|
<i class="md-icon osdIconButton-icon btnOsdFastForwardIcon"></i>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button is="paper-icon-button-light" class="osdIconButton btnNextTrack hide" title="${HeaderNextItem}" aria-label="${HeaderNextItem}">
|
<button is="paper-icon-button-light" class="osdIconButton btnNextTrack hide" title="${HeaderNextItem}" aria-label="${HeaderNextItem}">
|
||||||
|
|||||||
@ -264,6 +264,16 @@ define([
|
|||||||
fadeInAndOut(animate)),
|
fadeInAndOut(animate)),
|
||||||
_playbackmanager.default.fastForward(player);
|
_playbackmanager.default.fastForward(player);
|
||||||
}
|
}
|
||||||
|
function fastForwardSkipIntro(instance, animate) {
|
||||||
|
var player = instance.currentPlayer;
|
||||||
|
animate &&
|
||||||
|
(((animate = instance.view.querySelector(
|
||||||
|
".osd-ff-animationtext",
|
||||||
|
)).innerHTML =
|
||||||
|
"+" + parseInt(9e4 / 1e3)),
|
||||||
|
fadeInAndOut(animate)),
|
||||||
|
_playbackmanager.default.fastForwardSkipIntro(player);
|
||||||
|
}
|
||||||
function onOsdClick(e, instance, elementToFocusIfShowing, showOsdIfNoEvent) {
|
function onOsdClick(e, instance, elementToFocusIfShowing, showOsdIfNoEvent) {
|
||||||
var target = e.target;
|
var target = e.target;
|
||||||
if (target.closest(".videoOsdBottom"))
|
if (target.closest(".videoOsdBottom"))
|
||||||
@ -439,6 +449,7 @@ define([
|
|||||||
videoOsdDurationText = view.querySelector(".videoOsdDurationText"),
|
videoOsdDurationText = view.querySelector(".videoOsdDurationText"),
|
||||||
rewindButtons = view.querySelectorAll(".btnRewind"),
|
rewindButtons = view.querySelectorAll(".btnRewind"),
|
||||||
fastForwardButtons = view.querySelectorAll(".btnOsdFastForward"),
|
fastForwardButtons = view.querySelectorAll(".btnOsdFastForward"),
|
||||||
|
fastForwardSkipIntroButtons = view.querySelectorAll(".btnOsdFastForwardSkipIntro"),
|
||||||
stopButtons =
|
stopButtons =
|
||||||
((this.btnPause = view.querySelector(".videoOsd-btnPause")),
|
((this.btnPause = view.querySelector(".videoOsd-btnPause")),
|
||||||
view.querySelectorAll(".btnVideoOsd-stop")),
|
view.querySelectorAll(".btnVideoOsd-stop")),
|
||||||
@ -521,6 +532,7 @@ define([
|
|||||||
skipIntroContainer.classList.add("videoOsd-customFont-x2"),
|
skipIntroContainer.classList.add("videoOsd-customFont-x2"),
|
||||||
this.upNextContainer.classList.add("videoOsd-customFont-x2"),
|
this.upNextContainer.classList.add("videoOsd-customFont-x2"),
|
||||||
this.osdBottomElement.classList.add("videoOsd-nobuttonmargin"));
|
this.osdBottomElement.classList.add("videoOsd-nobuttonmargin"));
|
||||||
|
// I don't know what this does but it doesn't seem important for skipping intro
|
||||||
for (var i = 0, length = fastForwardButtons.length; i < length; i++) {
|
for (var i = 0, length = fastForwardButtons.length; i < length; i++) {
|
||||||
icon = btnFastForward = void 0;
|
icon = btnFastForward = void 0;
|
||||||
var btnFastForward = fastForwardButtons[i],
|
var btnFastForward = fastForwardButtons[i],
|
||||||
@ -954,6 +966,14 @@ define([
|
|||||||
fastForwardButtons[_i9].classList.remove("hide"),
|
fastForwardButtons[_i9].classList.remove("hide"),
|
||||||
(fastForwardButtons[_i9].disabled =
|
(fastForwardButtons[_i9].disabled =
|
||||||
!0 === state.IsInitialRequest);
|
!0 === state.IsInitialRequest);
|
||||||
|
for (
|
||||||
|
var _i9si = 0, _length9si = fastForwardSkipIntroButtons.length;
|
||||||
|
_i9si < _length9si;
|
||||||
|
_i9si++
|
||||||
|
)
|
||||||
|
fastForwardSkipIntroButtons[_i9si].classList.remove("hide"),
|
||||||
|
(fastForwardSkipIntroButtons[_i9si].disabled =
|
||||||
|
!0 === state.IsInitialRequest);
|
||||||
for (
|
for (
|
||||||
var _i10 = 0, _length10 = rewindButtons.length;
|
var _i10 = 0, _length10 = rewindButtons.length;
|
||||||
_i10 < _length10;
|
_i10 < _length10;
|
||||||
@ -968,6 +988,12 @@ define([
|
|||||||
_i11++
|
_i11++
|
||||||
)
|
)
|
||||||
fastForwardButtons[_i11].classList.add("hide");
|
fastForwardButtons[_i11].classList.add("hide");
|
||||||
|
for (
|
||||||
|
var _i11si = 0, _length11si = fastForwardSkipIntroButtons.length;
|
||||||
|
_i11si < _length11si;
|
||||||
|
_i11si++
|
||||||
|
)
|
||||||
|
fastForwardSkipIntroButtons[_i11si].classList.add("hide");
|
||||||
for (
|
for (
|
||||||
var _i12 = 0, _length12 = rewindButtons.length;
|
var _i12 = 0, _length12 = rewindButtons.length;
|
||||||
_i12 < _length12;
|
_i12 < _length12;
|
||||||
@ -1005,6 +1031,12 @@ define([
|
|||||||
_i7++
|
_i7++
|
||||||
)
|
)
|
||||||
fastForwardButtons[_i7].classList.add("hide");
|
fastForwardButtons[_i7].classList.add("hide");
|
||||||
|
for (
|
||||||
|
var _i7si = 0, _length7si = fastForwardSkipIntroButtons.length;
|
||||||
|
_i7si < _length7si;
|
||||||
|
_i7si++
|
||||||
|
)
|
||||||
|
fastForwardSkipIntroButtons[_i7si].classList.add("hide");
|
||||||
for (
|
for (
|
||||||
var _i8 = 0, _length8 = rewindButtons.length;
|
var _i8 = 0, _length8 = rewindButtons.length;
|
||||||
_i8 < _length8;
|
_i8 < _length8;
|
||||||
@ -1570,6 +1602,12 @@ define([
|
|||||||
_i13++
|
_i13++
|
||||||
)
|
)
|
||||||
fastForwardButtons[_i13].disabled = !playState.CanSeek;
|
fastForwardButtons[_i13].disabled = !playState.CanSeek;
|
||||||
|
for (
|
||||||
|
var _i13si = 0, _length13si = fastForwardSkipIntroButtons.length;
|
||||||
|
_i13si < _length13si;
|
||||||
|
_i13si++
|
||||||
|
)
|
||||||
|
fastForwardSkipIntroButtons[_i13si].disabled = !playState.CanSeek;
|
||||||
for (
|
for (
|
||||||
var _i14 = 0, _length14 = rewindButtons.length;
|
var _i14 = 0, _length14 = rewindButtons.length;
|
||||||
_i14 < _length14;
|
_i14 < _length14;
|
||||||
@ -2661,6 +2699,7 @@ define([
|
|||||||
onRewindButtonClick,
|
onRewindButtonClick,
|
||||||
{ passive: !0 },
|
{ passive: !0 },
|
||||||
);
|
);
|
||||||
|
|
||||||
function onFastForwardButtonClick() {
|
function onFastForwardButtonClick() {
|
||||||
fastForward(self, !0);
|
fastForward(self, !0);
|
||||||
}
|
}
|
||||||
@ -2675,6 +2714,22 @@ define([
|
|||||||
onFastForwardButtonClick,
|
onFastForwardButtonClick,
|
||||||
{ passive: !0 },
|
{ passive: !0 },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function onFastForwardSkipIntroButtonClick() {
|
||||||
|
fastForwardSkipIntro(self, !0);
|
||||||
|
}
|
||||||
|
for (
|
||||||
|
var _i20si = 0, _length20si = fastForwardSkipIntroButtons.length;
|
||||||
|
_i20si < _length20si;
|
||||||
|
_i20si++
|
||||||
|
)
|
||||||
|
_dom.default.addEventListener(
|
||||||
|
fastForwardButtons[_i20si],
|
||||||
|
"click",
|
||||||
|
onFastForwardSkipIntroButtonClick,
|
||||||
|
{ passive: !0 },
|
||||||
|
);
|
||||||
|
|
||||||
function onMoreClick() {
|
function onMoreClick() {
|
||||||
showMoreMenu(self.currentItem, this);
|
showMoreMenu(self.currentItem, this);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user