-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathRS_OnlyOGG.js
69 lines (62 loc) · 2.35 KB
/
RS_OnlyOGG.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//================================================================
// RS_OnlyOGG.js
// ---------------------------------------------------------------
// The MIT License
// Copyright (c) 2015 biud436
// ---------------------------------------------------------------
// Free for commercial and non commercial use.
//================================================================
/*:
* @plugindesc This plugin can play OGG files only in the RPG Maker MV.
* @author biud436
* @help
* =============================================================================
* Version Log
* =============================================================================*
* 2015.11.28 (v1.0.0) - First Release.
*/
/*:ko
* @plugindesc OGG 파일만 사용하여 앱 용량을 줄이고 M4A 오류를 제거합니다.
* @author biud436
* @help
* =============================================================================
* 동작 환경
* =============================================================================
* 안드로이드 킷캣 4.4.4
*
* 이 플러그인은 일부 안드로이드 기기에서 발생하는 M4A 관련 오류를 제거합니다.
* M4A을 포함하지 않아도 되기 때문에 게임 용량을 더 줄일 수 있습니다.
* =============================================================================
* 버전 로그
* =============================================================================
* 2015.11.28 (v1.0.0) - First Release.
*/
var Imported = Imported || {};
Imported.OnlyOGG = true;
(function() {
// if this is used for <community-1.3> or higher, it will break.
if(Utils.RPGMAKER_ENGINE && Utils.RPGMAKER_ENGINE.slice(-3) >= "1.3") {
return;
}
WebAudio._createContext = function() {
try {
this._context = new (AudioContext || webkitAudioContext || mozAudioContext)();
} catch (e) {
this._context = null;
}
};
WebAudio._detectCodecs = function() {
var audio = document.createElement('audio');
if (audio.canPlayType) {
this._canPlayOgg = audio.canPlayType('audio/ogg; codecs="vorbis"');
this._canPlayM4a = audio.canPlayType('audio/x-m4a');
}
};
AudioManager.audioFileExt = function() {
if (WebAudio.canPlayOgg()) {
return '.ogg';
} else {
return '.m4a';
}
};
})();