michael@0: michael@0: michael@0: # org.apache.cordova.vibration michael@0: michael@0: このプラグインに準拠 W3C 振動仕様 http://www.w3.org/TR/vibration/ michael@0: michael@0: このプラグインは、デバイスを振動させる方法を提供します。 michael@0: michael@0: ## インストール michael@0: michael@0: cordova plugin add org.apache.cordova.vibration michael@0: michael@0: michael@0: ## サポートされているプラットフォーム michael@0: michael@0: navigator.vibrate michael@0: navigator.notification.vibrate - アマゾン火 OS - アンドロイド - ブラックベリー 10 - Firefox OS - iOS - Windows Phone 7 と 8 michael@0: michael@0: navigator.notification.vibrateWithPattern、 michael@0: navigator.notification.cancelVibration - アンドロイド michael@0: michael@0: ## 振動 (推奨) michael@0: michael@0: この関数は、渡されたパラメーターに基づいて 3 つのさまざまな機能。 michael@0: michael@0: ### 標準を振動します。 michael@0: michael@0: 一定の時間のため、デバイスが振動します。 michael@0: michael@0: navigator.vibrate(time) michael@0: michael@0: michael@0: または michael@0: michael@0: navigator.vibrate([time]) michael@0: michael@0: michael@0: -**時刻**: ミリ秒、デバイスを振動させる。*(数)* michael@0: michael@0: #### 例 michael@0: michael@0: // Vibrate for 3 seconds michael@0: navigator.vibrate(3000); michael@0: michael@0: // Vibrate for 3 seconds michael@0: navigator.vibrate([3000]); michael@0: michael@0: michael@0: #### iOS の癖 michael@0: michael@0: * **時間**: 指定された時間を無視し、時間の事前に設定された量のために振動します。 michael@0: michael@0: navigator.vibrate(3000); // 3000 is ignored michael@0: michael@0: #### Windows とブラックベリー癖 michael@0: michael@0: * **時間**: 5000 (5 秒) は、最大時間と最小時間は 1 ms michael@0: michael@0: navigator.vibrate(8000); // will be truncated to 5000 michael@0: michael@0: ### (人造人間と Windows のみ) パターンで振動します。 michael@0: michael@0: 特定のパターンを持つデバイスが振動します。 michael@0: michael@0: navigator.vibrate(pattern); michael@0: michael@0: michael@0: * **パターン**: シーケンスの継続時間 (ミリ秒単位) をオンまたはオフ、バイブします。*(数字の配列)* michael@0: michael@0: #### 例 michael@0: michael@0: // Vibrate for 1 second michael@0: // Wait for 1 second michael@0: // Vibrate for 3 seconds michael@0: // Wait for 1 second michael@0: // Vibrate for 5 seconds michael@0: navigator.vibrate([1000, 1000, 3000, 1000, 5000]); michael@0: michael@0: michael@0: ### [キャンセル] 振動 (iOS ではサポートされていません) michael@0: michael@0: すぐに、現在実行中の振動をキャンセルします。 michael@0: michael@0: navigator.vibrate(0) michael@0: michael@0: michael@0: または michael@0: michael@0: navigator.vibrate([]) michael@0: michael@0: michael@0: または michael@0: michael@0: navigator.vibrate([0]) michael@0: michael@0: michael@0: 0 のパラメーターを渡して、空の配列、または 0 の値の 1 つの要素を持つ配列は任意振動がキャンセルされます。 michael@0: michael@0: ## *notification.vibrate (非推奨) michael@0: michael@0: 一定の時間のため、デバイスが振動します。 michael@0: michael@0: navigator.notification.vibrate(time) michael@0: michael@0: michael@0: * **時刻**: ミリ秒、デバイスを振動させる。*(数)* michael@0: michael@0: ### 例 michael@0: michael@0: // Vibrate for 2.5 seconds michael@0: navigator.notification.vibrate(2500); michael@0: michael@0: michael@0: ### iOS の癖 michael@0: michael@0: * **時間**: 指定された時間を無視し、時間の事前に設定された量のために振動します。 michael@0: michael@0: navigator.notification.vibrate(); michael@0: navigator.notification.vibrate(2500); // 2500 is ignored michael@0: michael@0: michael@0: ## *notification.vibrateWithPattern (非推奨) michael@0: michael@0: 特定のパターンを持つデバイスが振動します。 michael@0: michael@0: navigator.notification.vibrateWithPattern(pattern, repeat) michael@0: michael@0: michael@0: * **パターン**: シーケンスの継続時間 (ミリ秒単位) をオンまたはオフ、バイブします。*(数字の配列)* michael@0: * **繰り返します**: 省略可能な配列のインデックスのパターン (でしょう) を繰り返す取り消されるまで、繰り返しを開始するまたは反復なし (既定値) の場合は-1。*(数)* michael@0: michael@0: ### 例 michael@0: michael@0: // Immediately start vibrating michael@0: // vibrate for 100ms, michael@0: // wait for 100ms, michael@0: // vibrate for 200ms, michael@0: // wait for 100ms, michael@0: // vibrate for 400ms, michael@0: // wait for 100ms, michael@0: // vibrate for 800ms, michael@0: // (do not repeat) michael@0: navigator.notification.vibrateWithPattern([0, 100, 100, 200, 100, 400, 100, 800]); michael@0: michael@0: michael@0: ## *notification.cancelVibration (非推奨) michael@0: michael@0: すぐに、現在実行中の振動をキャンセルします。 michael@0: michael@0: navigator.notification.cancelVibration() michael@0: michael@0: michael@0: * 注 - w3c の仕様を配置、ため主演メソッドがフェーズ アウトされます。