Skip to content

Commit a37369c

Browse files
committed
Duck Player Native in both mode
1 parent 14749d0 commit a37369c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

injected/src/features.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const otherFeatures = /** @type {const} */ ([
3333
/** @typedef {baseFeatures[number]|otherFeatures[number]} FeatureName */
3434
/** @type {Record<string, FeatureName[]>} */
3535
export const platformSupport = {
36-
apple: ['webCompat', ...baseFeatures],
36+
apple: ['webCompat', 'duckPlayerNative',...baseFeatures],
3737
'apple-isolated': ['duckPlayer', 'duckPlayerNative', 'brokerProtection', 'performanceMetrics', 'clickToLoad', 'messageBridge', 'favicon'],
3838
android: [...baseFeatures, 'webCompat', 'breakageReporting', 'duckPlayer', 'messageBridge'],
3939
'android-broker-protection': ['brokerProtection'],

injected/src/features/duckplayer-native/get-current-timestamp.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @returns {number}
66
*/
77
export function getCurrentTimestamp(selector) {
8-
const video = /** @type {HTMLVideoElement|null} */ (document.querySelector(selector));
8+
const video = /** @type {HTMLVideoElement|null} */ (document.querySelector("video")); // TODO: Return to remote config
99
return video?.currentTime || 0;
1010
}
1111

@@ -22,6 +22,9 @@ export function getCurrentTimestamp(selector) {
2222
* @returns
2323
*/
2424
export function pollTimestamp(interval = 300, callback, selectors) {
25+
window.addEventListener("message", function(event) {
26+
console.log('MESSAGE', event);
27+
});
2528
if (!callback || !selectors) {
2629
console.error('Timestamp polling failed. No callback or selectors defined');
2730
}

0 commit comments

Comments
 (0)