danoniplus 43.6.3 → 43.6.4

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/js/danoni_main.js +22 -14
  2. package/package.json +1 -1
package/js/danoni_main.js CHANGED
@@ -4,12 +4,12 @@
4
4
  *
5
5
  * Source by tickle
6
6
  * Created : 2018/10/08
7
- * Revised : 2026/01/26
7
+ * Revised : 2026/01/31
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 43.6.3`;
12
- const g_revisedDate = `2026/01/26`;
11
+ const g_version = `Ver 43.6.4`;
12
+ const g_revisedDate = `2026/01/31`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -5760,7 +5760,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5760
5760
 
5761
5761
  /**
5762
5762
  * BGMのループ処理 (base64エンコード時用)
5763
- * - base64エンコード時はtimeupdateイベントが発火しないため、setIntervalで時間を取得する
5763
+ * - base64エンコード時はtimeupdateイベントが発火しないため、監視しながらループ処理を行う
5764
5764
  */
5765
5765
  const repeatBGM = () => {
5766
5766
  const numAtStart = g_settings.musicIdxNum;
@@ -5789,22 +5789,36 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5789
5789
  );
5790
5790
  };
5791
5791
 
5792
+ /**
5793
+ * 既存のAudio/AudioPlayerをクローズ
5794
+ */
5795
+ const closeExistingAudio = () => {
5796
+ if (g_stateObj.bgmTimeupdateEvtId !== null && g_stateObj.bgmTimeupdateEvtId !== undefined) {
5797
+ g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
5798
+ g_stateObj.bgmTimeupdateEvtId = null;
5799
+ }
5800
+ if (g_audioForMS instanceof AudioPlayer) {
5801
+ g_musicdata = ``;
5802
+ g_audioForMS.close();
5803
+ }
5804
+ };
5805
+
5792
5806
  if (encodeFlg) {
5793
5807
  try {
5794
5808
  // base64エンコードは読込に時間が掛かるため、曲変更時のみ読込
5795
5809
  if (!hasVal(g_musicdata) || Math.abs(_num) % g_headerObj.musicIdxList.length !== 0) {
5796
- if (g_audioForMS instanceof AudioPlayer) {
5797
- g_audioForMS.close();
5798
- }
5810
+ closeExistingAudio();
5799
5811
  await loadScript2(url);
5800
5812
  musicInit();
5801
5813
  if (!isTitle()) {
5814
+ g_musicdata = ``;
5802
5815
  return;
5803
5816
  }
5804
5817
  const tmpAudio = new AudioPlayer();
5805
5818
  const array = Uint8Array.from(atob(g_musicdata), v => v.charCodeAt(0));
5806
5819
  await tmpAudio.init(array.buffer);
5807
5820
  if (!isTitle()) {
5821
+ g_musicdata = ``;
5808
5822
  tmpAudio.close();
5809
5823
  return;
5810
5824
  }
@@ -5823,13 +5837,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5823
5837
 
5824
5838
  } else {
5825
5839
  // 既存の監視を解除し、AudioPlayer を確実にクローズ
5826
- if (g_stateObj.bgmTimeupdateEvtId) {
5827
- g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
5828
- g_stateObj.bgmTimeupdateEvtId = null;
5829
- }
5830
- if (g_audioForMS instanceof AudioPlayer) {
5831
- g_audioForMS.close();
5832
- }
5840
+ closeExistingAudio();
5833
5841
  g_audioForMS = new Audio();
5834
5842
  g_audioForMS.src = url;
5835
5843
  g_audioForMS.autoplay = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "43.6.3",
3
+ "version": "43.6.4",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "scripts": {