Pachelbel 1.1.4 → 1.1.5
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.
- checksums.yaml +4 -4
- data/lib/project/Pachelbel.rb +14 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84f1b658182f8fba5a14e8633462d3e55b1f875a
|
4
|
+
data.tar.gz: 15243bf6d9b5aee27846ecec728c0d64e569475a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60d4c5d2fbc556dee535c5d5ba2ad192597ca5bd0cb0bd5a0e4425025c7ecb9f52fb27a7a15698aba83f662c5f5f965d2d2bb4f5cf1bfd82588cc7bc019ef269
|
7
|
+
data.tar.gz: 89be2aee260ed1911fdabc2402e7dee26ef5fd155db179b362926862c9beb48003f6c9787cf8b46a4fe8e34901ee8da371778c4aa906d23afdd67e552f4694ad
|
data/lib/project/Pachelbel.rb
CHANGED
@@ -23,15 +23,22 @@ module Pachelbel
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def webViewDidFinishLoad(_)
|
26
|
-
run_js 'audio_context.createOscillator().noteOn(0);' # workaround to start timer
|
27
|
-
|
28
26
|
run_js 'var unlock_iframe = document.createElement("IFRAME");
|
29
27
|
unlock_iframe.setAttribute("src", "let://freedom.ring");'
|
30
28
|
|
31
|
-
run_js '
|
29
|
+
run_js 'var unlocked_function = function() { document.documentElement.appendChild(unlock_iframe); }'
|
30
|
+
|
31
|
+
run_js 'var pollster = function() { if (audio_context.currentTime === 0) { setTimeout(pollster, 0); } else { unlocked_function(); } }'
|
32
32
|
|
33
|
-
run_js '
|
34
|
-
|
33
|
+
run_js 'var unlocker_function = function() { audio_context.createOscillator().noteOn(0); setTimeout(pollster, 0); }'
|
34
|
+
|
35
|
+
case UIDevice.currentDevice.systemVersion[0]
|
36
|
+
when '7'
|
37
|
+
run_js 'unlocker_function();'
|
38
|
+
when '6'
|
39
|
+
run_js "var touch_function = function() { window.removeEventListener('touchstart', unlocker_function, false); unlocker_function(); }"
|
40
|
+
run_js "window.addEventListener('touchstart', touch_function, false);"
|
41
|
+
end
|
35
42
|
end
|
36
43
|
|
37
44
|
def webView(_, shouldStartLoadWithRequest: request, navigationType: _)
|
@@ -131,11 +138,11 @@ module Pachelbel
|
|
131
138
|
# API Methods
|
132
139
|
|
133
140
|
def start(time)
|
134
|
-
run_js("#{_js_snippet}.
|
141
|
+
run_js("#{_js_snippet}.noteOn(#{time});")
|
135
142
|
end
|
136
143
|
|
137
144
|
def stop(time)
|
138
|
-
run_js("#{_js_snippet}.
|
145
|
+
run_js("#{_js_snippet}.noteOff(#{time});")
|
139
146
|
end
|
140
147
|
end
|
141
148
|
end
|