danoniplus 41.4.15 → 41.4.16

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 41.4.15`;
12
- const g_revisedDate = `2026/01/26`;
11
+ const g_version = `Ver 41.4.16`;
12
+ const g_revisedDate = `2026/01/31`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -5639,7 +5639,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5639
5639
 
5640
5640
  /**
5641
5641
  * BGMのループ処理 (base64エンコード時用)
5642
- * - base64エンコード時はtimeupdateイベントが発火しないため、setIntervalで時間を取得する
5642
+ * - base64エンコード時はtimeupdateイベントが発火しないため、監視しながらループ処理を行う
5643
5643
  */
5644
5644
  const repeatBGM = () => {
5645
5645
  const numAtStart = g_settings.musicIdxNum;
@@ -5668,22 +5668,36 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5668
5668
  );
5669
5669
  };
5670
5670
 
5671
+ /**
5672
+ * 既存のAudio/AudioPlayerをクローズ
5673
+ */
5674
+ const closeExistingAudio = () => {
5675
+ if (g_stateObj.bgmTimeupdateEvtId !== null && g_stateObj.bgmTimeupdateEvtId !== undefined) {
5676
+ g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
5677
+ g_stateObj.bgmTimeupdateEvtId = null;
5678
+ }
5679
+ if (g_audioForMS instanceof AudioPlayer) {
5680
+ g_musicdata = ``;
5681
+ g_audioForMS.close();
5682
+ }
5683
+ };
5684
+
5671
5685
  if (encodeFlg) {
5672
5686
  try {
5673
5687
  // base64エンコードは読込に時間が掛かるため、曲変更時のみ読込
5674
5688
  if (!hasVal(g_musicdata) || Math.abs(_num) % g_headerObj.musicIdxList.length !== 0) {
5675
- if (g_audioForMS instanceof AudioPlayer) {
5676
- g_audioForMS.close();
5677
- }
5689
+ closeExistingAudio();
5678
5690
  await loadScript2(url);
5679
5691
  musicInit();
5680
5692
  if (!isTitle()) {
5693
+ g_musicdata = ``;
5681
5694
  return;
5682
5695
  }
5683
5696
  const tmpAudio = new AudioPlayer();
5684
5697
  const array = Uint8Array.from(atob(g_musicdata), v => v.charCodeAt(0));
5685
5698
  await tmpAudio.init(array.buffer);
5686
5699
  if (!isTitle()) {
5700
+ g_musicdata = ``;
5687
5701
  tmpAudio.close();
5688
5702
  return;
5689
5703
  }
@@ -5702,13 +5716,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5702
5716
 
5703
5717
  } else {
5704
5718
  // 既存の監視を解除し、AudioPlayer を確実にクローズ
5705
- if (g_stateObj.bgmTimeupdateEvtId) {
5706
- g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
5707
- g_stateObj.bgmTimeupdateEvtId = null;
5708
- }
5709
- if (g_audioForMS instanceof AudioPlayer) {
5710
- g_audioForMS.close();
5711
- }
5719
+ closeExistingAudio();
5712
5720
  g_audioForMS = new Audio();
5713
5721
  g_audioForMS.src = url;
5714
5722
  g_audioForMS.autoplay = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "41.4.15",
3
+ "version": "41.4.16",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "scripts": {