@novely/solid-renderer 0.24.1 → 0.25.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/dist/index.jsx +7 -8
  2. package/package.json +1 -1
package/dist/index.jsx CHANGED
@@ -4105,32 +4105,31 @@ var createAudio = (storageData) => {
4105
4105
  const getVolume = (type) => {
4106
4106
  return storageData.get().meta[TYPE_META_MAP[type]];
4107
4107
  };
4108
- const getHowl = (type, src, loop) => {
4108
+ const getHowl = (type, src) => {
4109
4109
  const kind = type === "voice" ? "voices" : type;
4110
4110
  const cached = store[kind][src];
4111
4111
  if (cached)
4112
4112
  return cached;
4113
4113
  const howl = new import_howler.Howl({
4114
4114
  src,
4115
- volume: getVolume(type),
4116
- loop
4115
+ volume: getVolume(type)
4117
4116
  });
4118
4117
  store[kind][src] = howl;
4119
4118
  return howl;
4120
4119
  };
4121
4120
  const context = {
4122
- music(src, method, loop = method === "music") {
4123
- const resource = getHowl(method, src, loop);
4124
- resource.loop(loop);
4121
+ music(src, method) {
4122
+ const resource = getHowl(method, src);
4125
4123
  this.start();
4126
4124
  return {
4127
4125
  pause() {
4128
4126
  resource.fade(getVolume(method), 0, 300);
4129
4127
  resource.once("fade", resource.pause);
4130
4128
  },
4131
- play() {
4129
+ play(loop) {
4132
4130
  if (resource.playing())
4133
4131
  return;
4132
+ resource.loop(loop);
4134
4133
  resource.play();
4135
4134
  resource.fade(0, getVolume(method), 300);
4136
4135
  },
@@ -4143,7 +4142,7 @@ var createAudio = (storageData) => {
4143
4142
  voice(source) {
4144
4143
  this.start();
4145
4144
  this.voiceStop();
4146
- const resource = store.voice = getHowl("voice", source, false);
4145
+ const resource = store.voice = getHowl("voice", source);
4147
4146
  resource.once("end", () => {
4148
4147
  store.voice = void 0;
4149
4148
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novely/solid-renderer",
3
- "version": "0.24.1",
3
+ "version": "0.25.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"