← Commit history

Publish 0.4.9

John Lauer ·1a84f12d6d · ·parent f02a424
3 files changed +17−4
package.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-video-player",   "type": "app",-  "version": "0.4.8",+  "version": "0.4.9",   "changelog": "0.4.8: skill cleanup: a shorter description, the display section points to the installed hydrogen-webview and hydrogen-pup skills (hdbw is now hbw), and publishing a video to the wiki points to adom-video-post.",   "title": "Adom Video Player",   "brief": "Show any video in a real player: seek, scrub, frame step, chapters. One command, no hand-rolled servers.",
page.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-video-player",   "type": "app",-  "version": "0.4.8",+  "version": "0.4.9",   "changelog": "0.4.8: skill cleanup: a shorter description, the display section points to the installed hydrogen-webview and hydrogen-pup skills (hdbw is now hbw), and publishing a video to the wiki points to adom-video-post.",   "title": "Adom Video Player",   "brief": "Show any video in a real player: seek, scrub, frame step, chapters. One command, no hand-rolled servers.",
public/adom-video.js+15−2
@@ -314,7 +314,18 @@       this._wire();     } +    // The tag's title is our heading, but as an attribute on the element the browser also shows it as a+    // native hover tooltip over the whole player. Keep the text, drop the attribute.+    _takeTitle() {+      if (!this.hasAttribute('title')) return;+      this._title = this.getAttribute('title');+      this._strippingTitle = true; this.removeAttribute('title'); this._strippingTitle = false;+    }+    _stripWrapperTitle() { const w = this.parentElement; if (w && w.classList && w.classList.contains('adom-widget') && w.hasAttribute('title')) { if (!this._title) this._title = w.getAttribute('title'); w.removeAttribute('title'); } }+     connectedCallback() {+      this._takeTitle();+      this._stripWrapperTitle();       if (!active) active = this;       if (location.pathname.includes('/widget/')) {         if (window.top === window) { this.classList.add('page'); this.p.classList.add('page'); }@@ -326,7 +337,9 @@       else this._load();     }     disconnectedCallback() { if (active === this) active = null; clearTimeout(this._t.hide); this.v.pause(); }-    attributeChangedCallback(n, a, b) { if (a !== b && this.isConnected && this._loaded) { if (n === 'video' || n === 'src') this._load(); else if (n === 'chapters') this._chapters(); else if (n === 'captions') this._captions(); else if (n === 'title') this.$('.top').textContent = b || ''; } }+    attributeChangedCallback(n, a, b) {+      if (n === 'title') { if (this._strippingTitle || b == null) return; this._takeTitle(); if (this._loaded) this.$('.top').textContent = this._opt('title') || ''; return; }+      if (a !== b && this.isConnected && this._loaded) { if (n === 'video' || n === 'src') this._load(); else if (n === 'chapters') this._chapters(); else if (n === 'captions') this._captions(); else if (n === 'title') this.$('.top').textContent = b || ''; } }      // absolute URL for a wiki path (the frame is opaque-origin, so resolve against the real location)     _abs(u) { try { return new URL(u, location.href).href; } catch { return u; } }@@ -352,7 +365,7 @@       if (el) { try { const j = JSON.parse(el.textContent); if (j && typeof j === 'object' && !Array.isArray(j)) this._man = j; } catch {} }       return this._man;     }-    _opt(n) { const a = this.getAttribute(n); if (a != null && a !== '') return a; const m = this._manifest(); return m && m[n] != null ? m[n] : null; }+    _opt(n) { const a = n === 'title' ? this._title : this.getAttribute(n); if (a != null && a !== '') return a; const m = this._manifest(); return m && m[n] != null ? m[n] : null; }      _load() {       this._loaded = true; this._man = undefined;