-
- This element is currently treated as player element.
-
-
-
-
- <{{element.tagName}}> {{element.id ? `#`:''}}{{element.id}} @ {{element.width}}x{{element.height}}
-
-
-
.{{cls}}
+
+
+
1. Start hovering over elements on this list
+
+
+
+
This list contains all the elements on the webpage that could be a video player.
+
Icons to the left of the list indicate which element is currently selected as the player element, which element the extension thinks to be the player element, and which element should be the player according to manual settings.
+
Move your mouse over the first element on the list, but do not click it.
+
Hovering over elements on the list will highlight parts of the page.
+
+
-
-
-
- This element matches query string (advanced settings)
-
-
- This element has been manually selected as player element.
-
-
- Automatic detections thinks this is the player.
-
-
-
This element has invalid dimensions
+
+
-
+
+
2. Observe highlight
+
+
+
+
Hovering over the elements will highlight part of the page. Highlighted area should cover the player area.
+
If the highlighted area covers the player, click the item on the list to select it and reload the page.
+
If more than one element covers the player area, select the first (topmost) one on the list.
+
+

+
+
+
+
+
+
+
+
If highlight covers more than just the player area, that usually means the correct element is further down the list.
+
Move the mouse cursor down the list of elements, until you encounter the first element that covers the player area.
+
+

+
+
+
+
+
+
+
If highlight doesn't cover the whole player area, that usually means the correct element is further down the list.
+
Move your cursor up the list of elements, until you encounter something that highlights the entire player area.
+
If more than one element covers the player area, select the first (topmost) one on the list.
+
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
If your video is not aligned correctly, video player was not detected correctly.
+
You need to help by selecting the video player. Hover over boxes below. This will highlight part of the screen.
+
Select the first box that highlights the video player on the page.
+
+
+
+
+
+
+
+
+
+
+
+
+ This element is currently treated as player element.
+
+
+
+
+ [{{element.index}}] <{{element.tagName}}> {{element.id ? `#`:''}}{{element.id}} @ {{element.width}}x{{element.height}}
+
+
+ .{{cls}}
+
+
+
+
+
+ This element matches query string (advanced settings)
+
+
+ This element has been manually selected as player element.
+
+
+ Automatic detections thinks this is the player.
+
+
+ This element has invalid dimensions
+
+
+
+
+
@@ -94,11 +169,16 @@ export default defineComponent({
data() {
return {
elementStack: [],
+ elementStacks: {
+ requestId: undefined,
+ stacks: []
+ },
cssStack: [],
showLegend: false,
showAdvancedOptions: false,
tutorialVisible: false,
- tutorialStep: 0
+ tutorialStep: 0,
+ lastTreeId: undefined,
};
},
computed: {
@@ -130,17 +210,47 @@ export default defineComponent({
this.tutorialStep = 0;
},
getPlayerTree() {
- this.eventBus.send('get-player-tree');
+ this.lastTreeId = crypto.randomUUID()
+ this.eventBus.send('get-player-tree', {requestId: this.lastTreeId});
},
handleElementStack(configBroadcast) {
if (configBroadcast.type === 'player-tree') {
- this.elementStack = configBroadcast.config.reverse();
- this.$nextTick( () => this.$forceUpdate() );
+ // reset tree if lastTreeId has changed
+ if (this.elementStacks.requestId !== this.lastTreeId) {
+ this.elementStacks = {
+ requestId: this.lastTreeId,
+ stacks: []
+ };
+ }
+
+ if (configBroadcast.requestId === this.lastTreeId) {
+ const stack = configBroadcast.elementStack.sort((a, b) => a.index - b.index);
+ this.elementStacks.stacks.push({
+ elementStack: stack
+ });
+ this.elementStack = stack;
+
+ this.$nextTick( () => this.$forceUpdate() );
+ }
}
},
markElement(parentIndex, enable) {
this.eventBus.send('set-mark-element', {parentIndex, enable});
},
+ async resetSettings() {
+ if (!this.siteSettings.raw?.activeDOMConfig) {
+ console.warn('')
+ return;
+ }
+
+ await this.siteSettings.setUpdateFlags(['PlayerData']);
+ await this.siteSettings.set(`DOMConfig.${this.siteSettings.data.activeDOMConfig}.player.detectionMode`, PlayerDetectionMode.Auto, {noSave: true});
+ await this.siteSettings.set(`DOMConfig.${this.siteSettings.data.activeDOMConfig}.player.ancestorIndex`, undefined);
+
+ this.getPlayerTree();
+ setTimeout( () => this.getPlayerTree(), 500);
+ setTimeout( () => this.getPlayerTree(), 1000);
+ },
/**
* Designates new element as player element. Currently, we only need
* 'index', however at some point we might also set mode according
@@ -170,6 +280,8 @@ export default defineComponent({
await this.siteSettings.set('activeDOMConfig', domConfigName);
this.getPlayerTree();
+ setTimeout(() => this.getPlayerTree(), 500);
+ setTimeout(() => this.getPlayerTree(), 1000);
},
/**
* Toggles active CSS for element of certain parent index.
diff --git a/src/ui/components/segments/PlayerElementSelection/PlayerElementWindow.vue b/src/ui/components/segments/PlayerElementSelection/PlayerElementWindow.vue
deleted file mode 100644
index bc9f1e3..0000000
--- a/src/ui/components/segments/PlayerElementSelection/PlayerElementWindow.vue
+++ /dev/null
@@ -1,216 +0,0 @@
-
-
-
-
Video player options
-
-
-
-
-
-
-
1. Start hovering over elements on this list
-
-
-
-
This list contains all the elements on the webpage that could be a video player.
-
Icons to the left of the list indicate which element is currently selected as the player element, which element the extension thinks to be the player element, and which element should be the player according to manual settings.
-
-

-
-
-
-
Move your mouse over the first element on the list, but do not click it.
-
Hovering over elements on the list will highlight parts of the page.
-
-

-
-
-
-
-
-
-
2. Observe highlight
-
-
-
-
-
Hovering over the elements will highlight part of the page. Highlighted area should cover the player area.
-
If the highlighted area covers the player, click the item on the list to select it and reload the page.
-
If more than one element covers the player area, select the first (topmost) one on the list.
-
-

-
-
-
-
-
-
-
-
If highlight covers more than just the player area, that usually means the correct element is further down the list.
-
Move the mouse cursor down the list of elements, until you encounter the first element that covers the player area.
-
-

-
-
-
-
-
-
-
If highlight doesn't cover the whole player area, that usually means the correct element is further down the list.
-
Move your cursor up the list of elements, until you encounter something that highlights the entire player area.
-
If more than one element covers the player area, select the first (topmost) one on the list.
-
-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-