|
@@ -6,7 +6,7 @@ import type { ResourceKey, TTPolicy } from "../types.js";
|
|
|
import { siteEvents } from "../siteEvents.js";
|
|
|
import { showPrompt } from "../dialogs/prompt.js";
|
|
|
|
|
|
-//#region vid time & vol.
|
|
|
+//#region vid elem
|
|
|
|
|
|
/** Returns the video element selector string based on the current domain */
|
|
|
export function getVideoSelector() {
|
|
@@ -22,6 +22,8 @@ export function getVideoElement() {
|
|
|
|
|
|
let vidElemReady = false;
|
|
|
|
|
|
+//#region vid time
|
|
|
+
|
|
|
/**
|
|
|
* Returns the current video time in seconds, with the given {@linkcode precision} (2 decimal digits by default).
|
|
|
* Rounds down if the precision is set to 0. The maximum average available precision on YTM is 6.
|
|
@@ -128,6 +130,8 @@ function ytForceShowVideoTime() {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+//#region vid ready
|
|
|
+
|
|
|
/**
|
|
|
* Waits for the video element to be in its readyState 4 / canplay state and returns it.
|
|
|
* Could take a very long time to resolve if the `/watch` page isn't open.
|