Pachelbel 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/project/Pachelbel.rb +14 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0df6394a20d061b0abe1a68a0cb3592649898dae
4
- data.tar.gz: 95d5cd1183ab4e39196aac40d42cbabfb5b2072a
3
+ metadata.gz: 84f1b658182f8fba5a14e8633462d3e55b1f875a
4
+ data.tar.gz: 15243bf6d9b5aee27846ecec728c0d64e569475a
5
5
  SHA512:
6
- metadata.gz: 2cbeb9745c2bbc4a3d32432fe32cc3475e40064629d1f3cc9e770680c445728cfa69d32d07d00e4ed17f1ca52df2601fe8c7977d62db23b6889061018f01b921
7
- data.tar.gz: e50146109c9bdd4b7178d54e3cdcd815a714bf32d9da8ddbc3d21289da4d485067a5f78f3e102f7240f7cbc7478343fab9cc925ec7416a75ab4b283e160b8063
6
+ metadata.gz: 60d4c5d2fbc556dee535c5d5ba2ad192597ca5bd0cb0bd5a0e4425025c7ecb9f52fb27a7a15698aba83f662c5f5f965d2d2bb4f5cf1bfd82588cc7bc019ef269
7
+ data.tar.gz: 89be2aee260ed1911fdabc2402e7dee26ef5fd155db179b362926862c9beb48003f6c9787cf8b46a4fe8e34901ee8da371778c4aa906d23afdd67e552f4694ad
@@ -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 'unlock_function = function() { document.documentElement.appendChild(unlock_iframe); }'
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 'pollster = function() { if (audio_context.currentTime === 0) { setTimeout(pollster, 0); } else { unlock_function(); } }'
34
- run_js 'setTimeout(pollster, 0);'
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}.start(#{time});")
141
+ run_js("#{_js_snippet}.noteOn(#{time});")
135
142
  end
136
143
 
137
144
  def stop(time)
138
- run_js("#{_js_snippet}.stop(#{time});")
145
+ run_js("#{_js_snippet}.noteOff(#{time});")
139
146
  end
140
147
  end
141
148
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Pachelbel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Drew Carey Buglione