@mfcc64/ytms 18.2.1 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/script.mjs +6 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mfcc64/ytms",
3
- "version": "18.2.1",
3
+ "version": "19.0.0",
4
4
  "description": "YouTube Musical Spectrum",
5
5
  "main": "script.mjs",
6
6
  "scripts": {
package/script.mjs CHANGED
@@ -16,7 +16,7 @@
16
16
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
  */
18
18
 
19
- import {ShowCQTElement, AutoResumeAudioContext} from "../../showcqt-element@2/showcqt-element.mjs";
19
+ import {ShowCQTElement} from "../../showcqt-element@3/showcqt-element.mjs";
20
20
 
21
21
  (async function(){
22
22
  const get_asset = (name) => String(new URL(`../ytms-assets@1.0.0/${name}`, import.meta.url));
@@ -167,13 +167,13 @@ import {ShowCQTElement, AutoResumeAudioContext} from "../../showcqt-element@2/sh
167
167
  af_links.shadowRoot.getElementById("message").style.display = "block";
168
168
  });
169
169
 
170
+ const cqt = new ShowCQTElement();
170
171
  let svideos = [];
171
172
  if (document.location.hostname == "soundcloud.com") {
172
- ShowCQTElement.global_audio_context = new AutoResumeAudioContext();
173
173
  const old = AudioContext.prototype.createMediaElementSource;
174
174
  AudioContext.prototype.createMediaElementSource = function(media) {
175
175
  const retval = old.call(this, media);
176
- if (this != ShowCQTElement.global_audio_context) {
176
+ if (this != cqt.audio_context) {
177
177
  console.warn("audio can't connect to showcqt-element");
178
178
  return retval;
179
179
  }
@@ -183,14 +183,13 @@ import {ShowCQTElement, AutoResumeAudioContext} from "../../showcqt-element@2/sh
183
183
  };
184
184
 
185
185
  window.AudioContext = function() {
186
- return ShowCQTElement.global_audio_context;
186
+ return cqt.audio_context;
187
187
  };
188
188
 
189
- Object.setPrototypeOf(window.AudioContext, AutoResumeAudioContext);
190
- window.AudioContext.prototype = AutoResumeAudioContext.prototype;
189
+ Object.setPrototypeOf(window.AudioContext, cqt.audio_context.constructor);
190
+ window.AudioContext.prototype = cqt.audio_context.constructor.prototype;
191
191
  }
192
192
 
193
- var cqt = new ShowCQTElement();
194
193
  set_fixed_style(cqt, 9999999);
195
194
  let stop_count = 0;
196
195
  const videos = document.getElementsByTagName("video");