|
|
|
@ -29,59 +29,59 @@ function create_fragment(ctx) {
|
|
|
|
|
audio_updating = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ctx.audio_timeupdate_handler.call(audio);
|
|
|
|
|
ctx[10].call(audio);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
c() {
|
|
|
|
|
audio = element("audio");
|
|
|
|
|
if (ctx.played === void 0 || ctx.currentTime === void 0 || ctx.ended === void 0) add_render_callback(audio_timeupdate_handler);
|
|
|
|
|
if (ctx.duration === void 0) add_render_callback(() => ctx.audio_durationchange_handler.call(audio));
|
|
|
|
|
if (ctx.buffered === void 0) add_render_callback(() => ctx.audio_progress_handler.call(audio));
|
|
|
|
|
if (ctx.buffered === void 0 || ctx.seekable === void 0) add_render_callback(() => ctx.audio_loadedmetadata_handler.call(audio));
|
|
|
|
|
if (ctx.seeking === void 0) add_render_callback(() => ctx.audio_seeking_seeked_handler.call(audio));
|
|
|
|
|
if (ctx.ended === void 0) add_render_callback(() => ctx.audio_ended_handler.call(audio));
|
|
|
|
|
if (ctx[2] === void 0 || ctx[3] === void 0 || ctx[9] === void 0) add_render_callback(audio_timeupdate_handler);
|
|
|
|
|
if (ctx[4] === void 0) add_render_callback(() => ctx[11].call(audio));
|
|
|
|
|
if (ctx[0] === void 0) add_render_callback(() => ctx[13].call(audio));
|
|
|
|
|
if (ctx[0] === void 0 || ctx[1] === void 0) add_render_callback(() => ctx[14].call(audio));
|
|
|
|
|
if (ctx[8] === void 0) add_render_callback(() => ctx[17].call(audio));
|
|
|
|
|
if (ctx[9] === void 0) add_render_callback(() => ctx[18].call(audio));
|
|
|
|
|
|
|
|
|
|
dispose = [
|
|
|
|
|
listen(audio, "timeupdate", audio_timeupdate_handler),
|
|
|
|
|
listen(audio, "durationchange", ctx.audio_durationchange_handler),
|
|
|
|
|
listen(audio, "play", ctx.audio_play_pause_handler),
|
|
|
|
|
listen(audio, "pause", ctx.audio_play_pause_handler),
|
|
|
|
|
listen(audio, "progress", ctx.audio_progress_handler),
|
|
|
|
|
listen(audio, "loadedmetadata", ctx.audio_loadedmetadata_handler),
|
|
|
|
|
listen(audio, "volumechange", ctx.audio_volumechange_handler),
|
|
|
|
|
listen(audio, "ratechange", ctx.audio_ratechange_handler),
|
|
|
|
|
listen(audio, "seeking", ctx.audio_seeking_seeked_handler),
|
|
|
|
|
listen(audio, "seeked", ctx.audio_seeking_seeked_handler),
|
|
|
|
|
listen(audio, "ended", ctx.audio_ended_handler)
|
|
|
|
|
listen(audio, "durationchange", ctx[11]),
|
|
|
|
|
listen(audio, "play", ctx[12]),
|
|
|
|
|
listen(audio, "pause", ctx[12]),
|
|
|
|
|
listen(audio, "progress", ctx[13]),
|
|
|
|
|
listen(audio, "loadedmetadata", ctx[14]),
|
|
|
|
|
listen(audio, "volumechange", ctx[15]),
|
|
|
|
|
listen(audio, "ratechange", ctx[16]),
|
|
|
|
|
listen(audio, "seeking", ctx[17]),
|
|
|
|
|
listen(audio, "seeked", ctx[17]),
|
|
|
|
|
listen(audio, "ended", ctx[18])
|
|
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
m(target, anchor) {
|
|
|
|
|
insert(target, audio, anchor);
|
|
|
|
|
|
|
|
|
|
if (!isNaN(ctx.volume)) {
|
|
|
|
|
audio.volume = ctx.volume;
|
|
|
|
|
if (!isNaN(ctx[6])) {
|
|
|
|
|
audio.volume = ctx[6];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isNaN(ctx.playbackRate)) {
|
|
|
|
|
audio.playbackRate = ctx.playbackRate;
|
|
|
|
|
if (!isNaN(ctx[7])) {
|
|
|
|
|
audio.playbackRate = ctx[7];
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
p(changed, ctx) {
|
|
|
|
|
if (!audio_updating && changed.currentTime && !isNaN(ctx.currentTime)) {
|
|
|
|
|
audio.currentTime = ctx.currentTime;
|
|
|
|
|
p(ctx, changed) {
|
|
|
|
|
if (!audio_updating && changed & 8 && !isNaN(ctx[3])) {
|
|
|
|
|
audio.currentTime = ctx[3];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (changed.paused && audio_is_paused !== (audio_is_paused = ctx.paused)) {
|
|
|
|
|
if (changed & 32 && audio_is_paused !== (audio_is_paused = ctx[5])) {
|
|
|
|
|
audio[audio_is_paused ? "pause" : "play"]();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (changed.volume && !isNaN(ctx.volume)) {
|
|
|
|
|
audio.volume = ctx.volume;
|
|
|
|
|
if (changed & 64 && !isNaN(ctx[6])) {
|
|
|
|
|
audio.volume = ctx[6];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (changed.playbackRate && !isNaN(ctx.playbackRate)) {
|
|
|
|
|
audio.playbackRate = ctx.playbackRate;
|
|
|
|
|
if (changed & 128 && !isNaN(ctx[7])) {
|
|
|
|
|
audio.playbackRate = ctx[7];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
audio_updating = false;
|
|
|
|
@ -111,67 +111,67 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
|
|
played = time_ranges_to_array(this.played);
|
|
|
|
|
currentTime = this.currentTime;
|
|
|
|
|
ended = this.ended;
|
|
|
|
|
$$invalidate("played", played);
|
|
|
|
|
$$invalidate("currentTime", currentTime);
|
|
|
|
|
$$invalidate("ended", ended);
|
|
|
|
|
$$invalidate(2, played);
|
|
|
|
|
$$invalidate(3, currentTime);
|
|
|
|
|
$$invalidate(9, ended);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function audio_durationchange_handler() {
|
|
|
|
|
duration = this.duration;
|
|
|
|
|
$$invalidate("duration", duration);
|
|
|
|
|
$$invalidate(4, duration);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function audio_play_pause_handler() {
|
|
|
|
|
paused = this.paused;
|
|
|
|
|
$$invalidate("paused", paused);
|
|
|
|
|
$$invalidate(5, paused);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function audio_progress_handler() {
|
|
|
|
|
buffered = time_ranges_to_array(this.buffered);
|
|
|
|
|
$$invalidate("buffered", buffered);
|
|
|
|
|
$$invalidate(0, buffered);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function audio_loadedmetadata_handler() {
|
|
|
|
|
buffered = time_ranges_to_array(this.buffered);
|
|
|
|
|
seekable = time_ranges_to_array(this.seekable);
|
|
|
|
|
$$invalidate("buffered", buffered);
|
|
|
|
|
$$invalidate("seekable", seekable);
|
|
|
|
|
$$invalidate(0, buffered);
|
|
|
|
|
$$invalidate(1, seekable);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function audio_volumechange_handler() {
|
|
|
|
|
volume = this.volume;
|
|
|
|
|
$$invalidate("volume", volume);
|
|
|
|
|
$$invalidate(6, volume);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function audio_ratechange_handler() {
|
|
|
|
|
playbackRate = this.playbackRate;
|
|
|
|
|
$$invalidate("playbackRate", playbackRate);
|
|
|
|
|
$$invalidate(7, playbackRate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function audio_seeking_seeked_handler() {
|
|
|
|
|
seeking = this.seeking;
|
|
|
|
|
$$invalidate("seeking", seeking);
|
|
|
|
|
$$invalidate(8, seeking);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function audio_ended_handler() {
|
|
|
|
|
ended = this.ended;
|
|
|
|
|
$$invalidate("ended", ended);
|
|
|
|
|
$$invalidate(9, ended);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$$self.$set = $$props => {
|
|
|
|
|
if ("buffered" in $$props) $$invalidate("buffered", buffered = $$props.buffered);
|
|
|
|
|
if ("seekable" in $$props) $$invalidate("seekable", seekable = $$props.seekable);
|
|
|
|
|
if ("played" in $$props) $$invalidate("played", played = $$props.played);
|
|
|
|
|
if ("currentTime" in $$props) $$invalidate("currentTime", currentTime = $$props.currentTime);
|
|
|
|
|
if ("duration" in $$props) $$invalidate("duration", duration = $$props.duration);
|
|
|
|
|
if ("paused" in $$props) $$invalidate("paused", paused = $$props.paused);
|
|
|
|
|
if ("volume" in $$props) $$invalidate("volume", volume = $$props.volume);
|
|
|
|
|
if ("playbackRate" in $$props) $$invalidate("playbackRate", playbackRate = $$props.playbackRate);
|
|
|
|
|
if ("seeking" in $$props) $$invalidate("seeking", seeking = $$props.seeking);
|
|
|
|
|
if ("ended" in $$props) $$invalidate("ended", ended = $$props.ended);
|
|
|
|
|
if ("buffered" in $$props) $$invalidate(0, buffered = $$props.buffered);
|
|
|
|
|
if ("seekable" in $$props) $$invalidate(1, seekable = $$props.seekable);
|
|
|
|
|
if ("played" in $$props) $$invalidate(2, played = $$props.played);
|
|
|
|
|
if ("currentTime" in $$props) $$invalidate(3, currentTime = $$props.currentTime);
|
|
|
|
|
if ("duration" in $$props) $$invalidate(4, duration = $$props.duration);
|
|
|
|
|
if ("paused" in $$props) $$invalidate(5, paused = $$props.paused);
|
|
|
|
|
if ("volume" in $$props) $$invalidate(6, volume = $$props.volume);
|
|
|
|
|
if ("playbackRate" in $$props) $$invalidate(7, playbackRate = $$props.playbackRate);
|
|
|
|
|
if ("seeking" in $$props) $$invalidate(8, seeking = $$props.seeking);
|
|
|
|
|
if ("ended" in $$props) $$invalidate(9, ended = $$props.ended);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
return [
|
|
|
|
|
buffered,
|
|
|
|
|
seekable,
|
|
|
|
|
played,
|
|
|
|
@ -191,7 +191,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
|
|
audio_ratechange_handler,
|
|
|
|
|
audio_seeking_seeked_handler,
|
|
|
|
|
audio_ended_handler
|
|
|
|
|
};
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Component extends SvelteComponent {
|
|
|
|
@ -200,15 +200,15 @@ class Component extends SvelteComponent {
|
|
|
|
|
|
|
|
|
|
init(this, options, instance, create_fragment, safe_not_equal, {
|
|
|
|
|
buffered: 0,
|
|
|
|
|
seekable: 0,
|
|
|
|
|
played: 0,
|
|
|
|
|
currentTime: 0,
|
|
|
|
|
duration: 0,
|
|
|
|
|
paused: 0,
|
|
|
|
|
volume: 0,
|
|
|
|
|
playbackRate: 0,
|
|
|
|
|
seeking: 0,
|
|
|
|
|
ended: 0
|
|
|
|
|
seekable: 1,
|
|
|
|
|
played: 2,
|
|
|
|
|
currentTime: 3,
|
|
|
|
|
duration: 4,
|
|
|
|
|
paused: 5,
|
|
|
|
|
volume: 6,
|
|
|
|
|
playbackRate: 7,
|
|
|
|
|
seeking: 8,
|
|
|
|
|
ended: 9
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|