|
|
@ -35,11 +35,12 @@ function create_fragment(ctx) {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
c() {
|
|
|
|
c() {
|
|
|
|
audio = element("audio");
|
|
|
|
audio = element("audio");
|
|
|
|
if (ctx.played === void 0 || ctx.currentTime === void 0) add_render_callback(audio_timeupdate_handler);
|
|
|
|
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.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) 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.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.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));
|
|
|
|
|
|
|
|
|
|
|
|
dispose = [
|
|
|
|
dispose = [
|
|
|
|
listen(audio, "timeupdate", audio_timeupdate_handler),
|
|
|
|
listen(audio, "timeupdate", audio_timeupdate_handler),
|
|
|
@ -51,7 +52,8 @@ function create_fragment(ctx) {
|
|
|
|
listen(audio, "volumechange", ctx.audio_volumechange_handler),
|
|
|
|
listen(audio, "volumechange", ctx.audio_volumechange_handler),
|
|
|
|
listen(audio, "ratechange", ctx.audio_ratechange_handler),
|
|
|
|
listen(audio, "ratechange", ctx.audio_ratechange_handler),
|
|
|
|
listen(audio, "seeking", ctx.audio_seeking_seeked_handler),
|
|
|
|
listen(audio, "seeking", ctx.audio_seeking_seeked_handler),
|
|
|
|
listen(audio, "seeked", ctx.audio_seeking_seeked_handler)
|
|
|
|
listen(audio, "seeked", ctx.audio_seeking_seeked_handler),
|
|
|
|
|
|
|
|
listen(audio, "ended", ctx.audio_ended_handler)
|
|
|
|
];
|
|
|
|
];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
m(target, anchor) {
|
|
|
|
m(target, anchor) {
|
|
|
@ -97,12 +99,15 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
|
let { volume } = $$props;
|
|
|
|
let { volume } = $$props;
|
|
|
|
let { playbackRate } = $$props;
|
|
|
|
let { playbackRate } = $$props;
|
|
|
|
let { seeking } = $$props;
|
|
|
|
let { seeking } = $$props;
|
|
|
|
|
|
|
|
let { ended } = $$props;
|
|
|
|
|
|
|
|
|
|
|
|
function audio_timeupdate_handler() {
|
|
|
|
function audio_timeupdate_handler() {
|
|
|
|
played = time_ranges_to_array(this.played);
|
|
|
|
played = time_ranges_to_array(this.played);
|
|
|
|
currentTime = this.currentTime;
|
|
|
|
currentTime = this.currentTime;
|
|
|
|
|
|
|
|
ended = this.ended;
|
|
|
|
$$invalidate("played", played);
|
|
|
|
$$invalidate("played", played);
|
|
|
|
$$invalidate("currentTime", currentTime);
|
|
|
|
$$invalidate("currentTime", currentTime);
|
|
|
|
|
|
|
|
$$invalidate("ended", ended);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function audio_durationchange_handler() {
|
|
|
|
function audio_durationchange_handler() {
|
|
|
@ -142,6 +147,11 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
|
$$invalidate("seeking", seeking);
|
|
|
|
$$invalidate("seeking", seeking);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function audio_ended_handler() {
|
|
|
|
|
|
|
|
ended = this.ended;
|
|
|
|
|
|
|
|
$$invalidate("ended", ended);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$$self.$set = $$props => {
|
|
|
|
$$self.$set = $$props => {
|
|
|
|
if ("buffered" in $$props) $$invalidate("buffered", buffered = $$props.buffered);
|
|
|
|
if ("buffered" in $$props) $$invalidate("buffered", buffered = $$props.buffered);
|
|
|
|
if ("seekable" in $$props) $$invalidate("seekable", seekable = $$props.seekable);
|
|
|
|
if ("seekable" in $$props) $$invalidate("seekable", seekable = $$props.seekable);
|
|
|
@ -152,6 +162,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
|
if ("volume" in $$props) $$invalidate("volume", volume = $$props.volume);
|
|
|
|
if ("volume" in $$props) $$invalidate("volume", volume = $$props.volume);
|
|
|
|
if ("playbackRate" in $$props) $$invalidate("playbackRate", playbackRate = $$props.playbackRate);
|
|
|
|
if ("playbackRate" in $$props) $$invalidate("playbackRate", playbackRate = $$props.playbackRate);
|
|
|
|
if ("seeking" in $$props) $$invalidate("seeking", seeking = $$props.seeking);
|
|
|
|
if ("seeking" in $$props) $$invalidate("seeking", seeking = $$props.seeking);
|
|
|
|
|
|
|
|
if ("ended" in $$props) $$invalidate("ended", ended = $$props.ended);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -164,6 +175,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
|
volume,
|
|
|
|
volume,
|
|
|
|
playbackRate,
|
|
|
|
playbackRate,
|
|
|
|
seeking,
|
|
|
|
seeking,
|
|
|
|
|
|
|
|
ended,
|
|
|
|
audio_timeupdate_handler,
|
|
|
|
audio_timeupdate_handler,
|
|
|
|
audio_durationchange_handler,
|
|
|
|
audio_durationchange_handler,
|
|
|
|
audio_play_pause_handler,
|
|
|
|
audio_play_pause_handler,
|
|
|
@ -171,7 +183,8 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
|
audio_loadedmetadata_handler,
|
|
|
|
audio_loadedmetadata_handler,
|
|
|
|
audio_volumechange_handler,
|
|
|
|
audio_volumechange_handler,
|
|
|
|
audio_ratechange_handler,
|
|
|
|
audio_ratechange_handler,
|
|
|
|
audio_seeking_seeked_handler
|
|
|
|
audio_seeking_seeked_handler,
|
|
|
|
|
|
|
|
audio_ended_handler
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -188,7 +201,8 @@ class Component extends SvelteComponent {
|
|
|
|
paused: 0,
|
|
|
|
paused: 0,
|
|
|
|
volume: 0,
|
|
|
|
volume: 0,
|
|
|
|
playbackRate: 0,
|
|
|
|
playbackRate: 0,
|
|
|
|
seeking: 0
|
|
|
|
seeking: 0,
|
|
|
|
|
|
|
|
ended: 0
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|