diff --git a/src/_locales b/src/_locales index 6ded459..2bb8521 160000 --- a/src/_locales +++ b/src/_locales @@ -1 +1 @@ -Subproject commit 6ded459000701b907c7d5587d62b7ccb9294ea25 +Subproject commit 2bb852120b246f6ba3241bc362e80fe1876d163a diff --git a/src/entry-points/content/AllMediaElementsController.ts b/src/entry-points/content/AllMediaElementsController.ts index 0190779..60643bf 100644 --- a/src/entry-points/content/AllMediaElementsController.ts +++ b/src/entry-points/content/AllMediaElementsController.ts @@ -57,6 +57,11 @@ export type TelemetryMessage = elementLikelyCorsRestricted: boolean, elementCurrentSrc?: string, createMediaElementSourceCalledForElement: boolean, + /** + * Remember that this could be `Infinity` for live streams, + * and if `.duration` is otherwise unknown. + */ + elementRemainingIntrinsicDuration: number, }; function executeNonSettingsActions( @@ -330,6 +335,7 @@ export default class AllMediaElementsController { elementCurrentSrc: elementLikelyCorsRestricted ? this.activeMediaElement.currentSrc : undefined, // TODO check if the map lookup is too slow to do it several times per second. createMediaElementSourceCalledForElement: !!mediaElementSourcesMap.get(this.activeMediaElement), + elementRemainingIntrinsicDuration: this.activeMediaElement.duration - this.activeMediaElement.currentTime, }; port.postMessage(telemetryMessage); }; diff --git a/src/entry-points/popup/App.svelte b/src/entry-points/popup/App.svelte index 69ddaee..7a40e44 100644 --- a/src/entry-points/popup/App.svelte +++ b/src/entry-points/popup/App.svelte @@ -391,6 +391,11 @@ along with Jump Cutter Browser Extension. If not, see + + {#if estimatedRemainingDuration != undefined && + // 10,000 hour sanity check + estimatedRemainingDuration < (10000*60*60) + } +

+ {getMessage('estimatedRemainingDuration')}
+ {mmSs(estimatedRemainingDuration)} +

+ {/if} +

{getMessage('timeSavedPercentage')}