Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 40129E3A8 for ; Wed, 2 Jan 2013 22:25:40 +0000 (UTC) Received: (qmail 61959 invoked by uid 500); 2 Jan 2013 22:25:39 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 61895 invoked by uid 500); 2 Jan 2013 22:25:39 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 61425 invoked by uid 99); 2 Jan 2013 22:25:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2013 22:25:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2B48F821A9D; Wed, 2 Jan 2013 22:25:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: mwbrooks@apache.org To: commits@cordova.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [4/16] Copy docs/jp/2.0.0 to docs/jp/2.1.0 Message-Id: <20130102222539.2B48F821A9D@tyr.zones.apache.org> Date: Wed, 2 Jan 2013 22:25:39 +0000 (UTC) http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/capture/captureVideo.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/capture/captureVideo.md b/docs/jp/2.1.0/cordova/media/capture/captureVideo.md new file mode 100644 index 0000000..4427639 --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/capture/captureVideo.md @@ -0,0 +1,159 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +capture.captureVideo +==================== + +> ビデオ録画アプリを起動し、キャプチャーしたビデオファイルの情報を返します。 + + navigator.device.capture.captureVideo( + CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options] + ); + +概要 +----------- + +このメソッドは、デバイスのビデオ録画アプリを使用して、ビデオをキャプチャーするための非同期操作を開始します。この操作はユーザーに、単一セッションで複数のビデオのキャプチャーをユーザーに許可します。 + +キャプチャー操作は、ユーザーがビデオ録画アプリを終了するか、 CaptureVideoOptions の中の __limit__ パラメーターで指定された最大録画回数に達した場合に終了します。もし __limit__ パラメーターが指定されていない場合は、デフォルト値である1が使用され、キャプチャー操作はユーザーが1度ビデオを録画した後に終了します。 + +キャプチャー操作が終了した時、それぞれのビデオ録画ファイル情報が書かれた MediaFile オブジェクトの配列を伴った CaptureCB コールバック関数を呼び出します。もしオーディオがキャプチャーされる前にユーザーによって操作が終了されたら、 CaptureError.`CAPTURE_NO_MEDIA_FILES` エラーコードを持つ CaptureError オブジェクトを伴った CaptureErrorCB コールバック関数が呼び出されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 (Mango) +- Bada 2.x + +使用例 +------------- + + // capture コールバック関数 + var captureSuccess = function(mediaFiles) { + var i, path, len; + for (i = 0, len = mediaFiles.length; i < len; i += 1) { + path = mediaFiles[i].fullPath; + // ファイルを使用した処理 + } + }; + + // capture エラーコールバック関数 + var captureError = function(error) { + navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); + }; + + // ビデオキャプチャーを開始 + navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2}); + +詳細な使用例 +------------ + + + + + ビデオキャプチャー + + + + + + +
+ + + +BlackBerry WebWorks に関する注意点 +-------------------------- + +- Cordova for BlackBerry WebWorks は、ビデオ録画のために RIM より提供されている __Video Recorder__ の起動を試みます。デベロッパーは、もしアプリがインストールされていない場合は CaptureError.`CAPTURE_NOT_SUPPORTED` エラーを受け取ります。 + +Bada 2.x に関する注意点 +--------------- + +Bada は _captureVideo_ を他のデバイスと同様にサポートします。しかしながら、カメラアプリを起動せずにビデオや画像を webview 内でキャプチャー出来る _別の_ モードが存在します。このモードを使うためには、以下の手順が必要です: + +1. _<div>_ 要素をドキュメントのどこかに作成し、 "preview" といったような id を付与します + +
+ +2. カメラプレビューを以下のメソッドで初期化します + + navigator.camera.showPreview("preview"); + +3. プレビューを取得した後、以下のことが可能です + + 3.1 ビデオのキャプチャーを開始 + + navigator.capture.startVideoCapture(success, fail, {duration: 5000, destinationFilename: "videos/a.3gp"}); + + 3.2 ビデオのキャプチャーを停止 + + navigator.capture.stopVideoCapture(); + +3. 以下のメソッドでカメラプレビュー画面を隠します + + navigator.camera.hidePreview("preview"); + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/capture/captureVideoOptions.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/capture/captureVideoOptions.md b/docs/jp/2.1.0/cordova/media/capture/captureVideoOptions.md new file mode 100644 index 0000000..0d1b7f5 --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/capture/captureVideoOptions.md @@ -0,0 +1,59 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +CaptureVideoOptions +=================== + +> ビデオキャプチャーのオプションをカプセル化します。 + +プロパティー +---------- + +- __limit:__ 一つのキャプチャー操作で録画できるビデオの最大値を表します。値は1以上の必要があります (デフォルトは1です) 。 +- __duration:__ ビデオクリップの最大録画時間を秒で表します。 +- __mode:__ 選択されたビデオのモードを表します。値は `capture.supportedVideoModes` の中の一つである必要があります。 + +使用例 +------------- + + // キャプチャー操作時のビデオクリップの最大値を3に制限 + var options = { limit: 3 }; + + navigator.device.capture.captureVideo(captureSuccess, captureError, options); + +Android に関する注意点 +-------------- + +- __duration__ パラメーターはサポートされていません。録画時間をプログラム的に制限することは出来ません。 +- __mode__ パラメーターはサポートされていません。ビデオのサイズとフォーマットはプログラム的に変更することはできません。しかし、これらのパラメーターはユーザーによって変更することは可能です。デフォルトでは、ビデオは 3GPP (video/3gpp) フォーマットで録画されます。 + + +BlackBerry WebWorks に関する注意点 +-------------------------- + +- __duration__ パラメーターはサポートされていません。 録画時間をプログラム的に制限することは出来ません。 +- __mode__ パラメーターはサポートされていません。 ビデオのサイズとフォーマットはプログラム的に変更することはできません。しかし、これらのパラメーターはユーザーによって変更することは可能です。 デフォルトでは、ビデオは 3GPP (video/3gpp) フォーマットで録画されます。 + +iOS に関する注意点 +---------- + +- __limit__ パラメーターはサポートされていません。1つのキャプチャー操作につき1つのビデオが録画されます。 +- __duration__ パラメーターはサポートされていません。録画時間をプログラム的に制限することは出来ません。 +- __mode__ パラメーターはサポートされていません。ビデオのサイズとフォーマットはプログラム的に変更することはできません。デフォルトでは、ビデオは MOV (video/quicktime) フォーマットで録画されます。 + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/media.getCurrentPosition.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/media.getCurrentPosition.md b/docs/jp/2.1.0/cordova/media/media.getCurrentPosition.md new file mode 100644 index 0000000..f241fe8 --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/media.getCurrentPosition.md @@ -0,0 +1,173 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +media.getCurrentPosition +======================== + +オーディオファイル内の現在の再生位置を返します。 + + media.getCurrentPosition(mediaSuccess, [mediaError]); + +パラメーター +---------- + +- __mediaSuccess__: 現在再生位置とともに呼ばれるコールバック関数を表します +- __mediaError__: (オプション) エラー発生時に呼ばれるコールバック関数を表します + +概要 +----------- + +`media.getCurrentPosition` 関数は Media オブジェクトのオーディオファイルの現在再生位置を返す非同期関数です。 Media オブジェクト内の __position__ パラメーターの値も更新します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 (Mango) + +使用例 +------------- + + // オーディオプレイヤー + // + var my_media = new Media(src, onSuccess, onError); + + // メディアの再生位置を一秒ごとに更新 + var mediaTimer = setInterval(function() { + // 再生位置を取得 + my_media.getCurrentPosition( + // 呼び出し成功 + function(position) { + if (position > -1) { + console.log((position) + " sec"); + } + }, + // 呼び出し失敗 + function(e) { + console.log("Error getting pos=" + e); + } + ); + }, 1000); + + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/media.getDuration.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/media.getDuration.md b/docs/jp/2.1.0/cordova/media/media.getDuration.md new file mode 100644 index 0000000..a945228 --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/media.getDuration.md @@ -0,0 +1,165 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +media.getDuration +================= + +オーディオファイルの再生時間を返します。 + + media.getDuration(); + + +概要 +----------- + +`media.getDuration` 関数は秒単位でオーディオファイルの再生時間を返す同期関数です。再生時間が不明な場合は、-1が返されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 (Mango) + +使用例 +------------- + + // オーディオプレイヤー + // + var my_media = new Media(src, onSuccess, onError); + + // 再生時間を取得 + var counter = 0; + var timerDur = setInterval(function() { + counter = counter + 100; + if (counter > 2000) { + clearInterval(timerDur); + } + var dur = my_media.getDuration(); + if (dur > 0) { + clearInterval(timerDur); + document.getElementById('audio_duration').innerHTML = (dur) + " sec"; + } + }, 100); + + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/media.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/media.md b/docs/jp/2.1.0/cordova/media/media.md new file mode 100644 index 0000000..08e7aa5 --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/media.md @@ -0,0 +1,121 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +Media +===== + +> `Media` オブジェクトは、デバイス上でのオーディオファイルの再生や録音などといった機能をサポートします。 + + var media = new Media(src, mediaSuccess, [mediaError], [mediaStatus]); + + +注意: 現在の実装はメディアキャプチャーに関する W3C の仕様を満たしていません。利便性のためだけに提供されています。将来的には最新の W3C の仕様に合わせるとともに、現在の API を廃止することも検討されています。 + +パラメーター +---------- + +- __src__: オーディオコンテンツを示す URI を表します _(DOMString)_ +- __mediaSuccess__: (オプション) Media オブジェクトが再生、録音、停止などのアクションを完了したときに呼ばれるコールバック関数を表します _(Function)_ +- __mediaError__: (オプション) エラー発生時に呼ばれるコールバック関数を表します _(Function)_ +- __mediaStatus__: (オプション) ステータスが変わったときに呼ばれるコールバック関数を表します _(Function)_ + +メソッド +------- + +- media.getCurrentPosition: オーディオファイル内の現在の再生位置を返します +- media.getDuration: オーディオファイルの再生時間を返します +- media.play: オーディオファイルを再生または再開します +- media.pause: オーディオファイルを一時停止します +- media.release: OS のオーディオリソースを開放します +- media.seekTo: オーディオファイル中の再生位置を動かします +- media.startRecord: オーディオファイルの録音を開始します +- media.stopRecord: オーディオファイルの録音を停止します +- media.stop: オーディオファイルを停止します + +追加の読み取り専用パラメーター +--------------------- + +- __position__: 再生位置を秒単位で表します。 + - 再生中は自動的に値が更新されないので、 `getCurrentPosition` メソッドを呼び、値を更新します +- __duration__: メディアの再生時間を秒単位で表します + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 (Mango) + +パーミッション +----------- + +### Android + +#### app/res/xml/plugins.xml + + + +#### app/AndroidManifest.xml + + + + + +### Bada + +#### manifest.xml + + + RECORDING + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +### iOS + +#### App/Supporting Files/Cordova.plist + + Plugins + + Media + CDVSound + + +### webOS + + パーミッションの設定は必要ありません。 + +### Windows Phone + +#### Properties/WPAppManifest.xml + + + + + + + + + +参照: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx) http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/media.pause.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/media.pause.md b/docs/jp/2.1.0/cordova/media/media.pause.md new file mode 100644 index 0000000..825a8e3 --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/media.pause.md @@ -0,0 +1,169 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +media.pause +=========== + +オーディオファイルを一時停止します。 + + media.pause(); + + +概要 +----------- + +`media.pause` 関数はオーディオファイルを一時停止させる同期関数です。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 (Mango) + +使用例 +------------- + + // オーディオ再生 + // + function playAudio(url) { + // URL のオーディオファイルを再生 + var my_media = new Media(url, + // 呼び出し成功 + function() { + console.log("playAudio():Audio Success"); + }, + // 呼び出し失敗 + function(err) { + console.log("playAudio():Audio Error: "+err); + }); + + // オーディオ再生 + my_media.play(); + + // 10秒後に一時停止 + setTimeout(function() { + media.pause(); + }, 10000); + } + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/media.play.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/media.play.md b/docs/jp/2.1.0/cordova/media/media.play.md new file mode 100644 index 0000000..44a8852 --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/media.play.md @@ -0,0 +1,188 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +media.play +========== + +オーディオファイルを再生または再開します。 + + media.play(); + + +概要 +----------- + +`media.play` 関数はオーディオファイルを再生または再開させる同期関数です。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 (Mango) + +使用例 +------------- + + // オーディオ再生 + // + function playAudio(url) { + // URL のオーディオファイルを再生 + var my_media = new Media(url, + // 呼び出し成功 + function() { + console.log("playAudio():Audio Success"); + }, + // 呼び出し失敗 + function(err) { + console.log("playAudio():Audio Error: "+err); + }); + + // オーディオ再生 + my_media.play(); + } + + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + + +BlackBerry WebWorks に関する注意点 +---------- + +- BlackBerry は同時に再生できるオーディオの数が決まっています。 CDMA デバイスは1つのオーディオのみサポートしています。他のデバイスは2つまで同時再生をサポートしています。サポートされている数以上のオーディオファイルを再生することは、直前の再生オーディオを停止することに繋がります。 + +iOS に関する注意点 +--------- + +- __numberOfLoops__ + + このオプションを **play** メソッドに渡すことで、そのメディアファイルを何回再生するかを指定します。例: + + var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3") + myMedia.play({ numberOfLoops: 2 }) + +- __playAudioWhenScreenIsLocked__ + + このオプションを **play** メソッドに渡すことで、スクリーンがロックされた状態でもオーディオを再生するかどうかを指定します (設定しなかった場合、デフォルトは true です) 。もし true にセットされた場合は、ハードウェアのミュートボタンの設定は無視されます。例: + + var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3") + myMedia.play({ playAudioWhenScreenIsLocked : false }) http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/media.release.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/media.release.md b/docs/jp/2.1.0/cordova/media/media.release.md new file mode 100644 index 0000000..c116b0c --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/media.release.md @@ -0,0 +1,154 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +media.release +================= + +OS のオーディオリソースを開放します。 + + media.release(); + + +概要 +----------- + +`media.release` 関数は OS のオーディオリソースを開放する同期関数です。 Android ではメディア再生のための OpenCore インスタンスが有限のため、この関数は特に Android にとって重要な関数です。 メディアリソースが不要になった場合には、 'release' 関数を使用してください。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 (Mango) + +使用例 +------------- + + // オーディオプレイヤー + // + var my_media = new Media(src, onSuccess, onError); + + my_media.play(); + my_media.stop(); + my_media.release(); + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/media.seekTo.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/media.seekTo.md b/docs/jp/2.1.0/cordova/media/media.seekTo.md new file mode 100644 index 0000000..ee0e2ce --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/media.seekTo.md @@ -0,0 +1,157 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +media.seekTo +======================== + +オーディオファイル中の再生位置を動かします。 + + media.seekTo(milliseconds); + +パラメーター +---------- + +- __milliseconds__: 再生位置を動かす先の位置をミリ秒単位で表します + + +概要 +----------- + +`media.seekTo` 関数は Media オブジェクトのオーディオファイルの現在再生位置を更新する非同期関数です。 Media オブジェクト内の __position__ パラメーターの値も更新します。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 6.0 以上) +- iOS +- Windows Phone 7 (Mango) + +使用例 +------------- + + // オーディオプレイヤー + // + var my_media = new Media(src, onSuccess, onError); + my_media.play(); + // 5秒後に、10秒の位置まで移動 + setTimeout(function() { + my_media.seekTo(10000); + }, 5000); + + +Full Example +------------ + + + + + メディアの使用例 + + + + + + 再生 + 停止 +

+ + + +BlackBerry WebWorks に関する注意点 +---------- + +- この API は BlackBerry OS 5 デバイスではサポートされていません。 http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/media.startRecord.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/media.startRecord.md b/docs/jp/2.1.0/cordova/media/media.startRecord.md new file mode 100644 index 0000000..b336a8b --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/media.startRecord.md @@ -0,0 +1,141 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +media.startRecord +================= + +オーディオファイルの録音を開始します。 + + media.startRecord(); + + +概要 +----------- + +`media.startRecord` 関数はオーディオファイルの録音を開始する同期関数です。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 (Mango) + +使用例 +------------- + + // オーディオの録音 + // + function recordAudio() { + var src = "myrecording.mp3"; + var mediaRec = new Media(src, + // 呼び出し成功 + function() { + console.log("recordAudio():Audio Success"); + }, + + // 呼び出し失敗 + function(err) { + console.log("recordAudio():Audio Error: "+ err.code); + }); + + // オーディオの録音 + mediaRec.startRecord(); + } + + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

オーディオを録音...

+

+ + + +BlackBerry WebWorks に関する注意点 +---------- + +- BlackBerry デバイスはオーディオを Adaptive Multi-Rate フォーマットで録音します。ファイル名は .amr 拡張子で指定される必要があります。 + +iOS に関する注意点 +---------- + +- 録音するためのファイルは既に .wav 形式で存在していなければなりません。 File API 群を使用することでファイルを作成することができます。 http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/media.stop.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/media.stop.md b/docs/jp/2.1.0/cordova/media/media.stop.md new file mode 100644 index 0000000..e64df50 --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/media.stop.md @@ -0,0 +1,169 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +media.stop +========== + +オーディオファイルを停止します。 + + media.stop(); + + +概要 +----------- + +`media.stop` 関数はオーディオファイルを停止させる同期関数です。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 (Mango) + +使用例 +------------- + + // オーディオ再生 + // + function playAudio(url) { + // URL のオーディオファイルを再生 + var my_media = new Media(url, + // 呼び出し成功 + function() { + console.log("playAudio():Audio Success"); + }, + // 呼び出し失敗 + function(err) { + console.log("playAudio():Audio Error: "+err); + }); + + // オーディオ再生 + my_media.play(); + + // 10秒後に一時停止 + setTimeout(function() { + my_media.stop(); + }, 10000); + } + +詳細な使用例 +------------ + + + + + メディアの使用例 + + + + + + 再生 + 一時停止 + 停止 +

+ + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/media/media.stopRecord.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/media/media.stopRecord.md b/docs/jp/2.1.0/cordova/media/media.stopRecord.md new file mode 100644 index 0000000..9bbe08f --- /dev/null +++ b/docs/jp/2.1.0/cordova/media/media.stopRecord.md @@ -0,0 +1,139 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +media.stopRecord +================ + +オーディオファイルの録音を停止します。 + + media.stopRecord(); + + +概要 +----------- + +`media.stopRecord` 関数はオーディオファイルの録音を停止させる同期関数です。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iOS +- Windows Phone 7 (Mango) + +使用例 +------------- + + // オーディオの録音 + // + function recordAudio() { + var src = "myrecording.mp3"; + var mediaRec = new Media(src, + // 呼び出し成功 + function() { + console.log("recordAudio():Audio Success"); + }, + + // 呼び出し失敗 + function(err) { + console.log("recordAudio():Audio Error: "+ err.code); + }); + + // オーディオの録音 + mediaRec.startRecord(); + + // 10秒後に録音を停止 + setTimeout(function() { + mediaRec.stopRecord(); + }, 10000); + } + + +詳細な使用例 +------------ + + + + + デバイスプロパティーの使用例 + + + + + +

オーディオを録音...

+

+ + + + + http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/notification/notification.alert.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/notification/notification.alert.md b/docs/jp/2.1.0/cordova/notification/notification.alert.md new file mode 100644 index 0000000..3ccfe5c --- /dev/null +++ b/docs/jp/2.1.0/cordova/notification/notification.alert.md @@ -0,0 +1,115 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +notification.alert +================== + +通知ダイアログボックスを表示します。 + + navigator.notification.alert(message, alertCallback, [title], [buttonName]) + +- __message:__ ダイアログのメッセージを表します (`String`) +- __alertCallback:__ 通知ダイアログが確認された後に呼び出されるコールバック関数を表します (`Function`) +- __title:__ ダイアログのタイトルを表します (`String`) (オプション, デフォルト: "Alert") +- __buttonName:__ ボタンの名前を表します (`String`) (オプション, デフォルト: "OK") + +概要 +----------- + +ほとんどの Cordova の実装はネイティブのダイアログボックスを使用しています。一部のプラットフォームのみブラウザの `alert` 関数を使っており、通常これらはカスタマイズが制限されます。 + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iPhone +- Windows Phone 7 (Mango) +- Bada 1.2 & 2.x + +使用例 +------------- + + // Android / BlackBerry WebWorks (OS 5.0 以上) / iPhone + // + function alertDismissed() { + // 任意のコード + } + + navigator.notification.alert( + 'あなたの勝ちです!', // メッセージ + alertDismissed, // コールバック関数 + 'ゲームオーバー', // タイトル + '終了' // ボタン名 + ); + +詳細な使用例 +------------ + + + + + Notification の使用例 + + + + + +

通知を表示

+ + + +Windows Phone 7 に関する注意点 +------------- + +- ボタンの名前は無視され、常に 'OK' が使用されます。 +- ビルトインのブラウザ通知ダイアログ機能はないため、もし alert('foo'); とだけ書きたい場合は、 window.alert = navigator.notification.alert; と window.alert に Cordova の notification.alert をアサインできます。 +- 通知と確認の呼び出しはノンブロッキングで、結果は非同期でのみ取得可能です。 + +Bada 2.xに関する注意点 +--------------- +- 通知は、 Javascript の alert を使用します。 http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/notification/notification.beep.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/notification/notification.beep.md b/docs/jp/2.1.0/cordova/notification/notification.beep.md new file mode 100644 index 0000000..ff3e06b --- /dev/null +++ b/docs/jp/2.1.0/cordova/notification/notification.beep.md @@ -0,0 +1,113 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +notification.beep +================= + +デバイスが警告音を鳴らします。 + + navigator.notification.beep(times); + +- __times:__ 警告音を鳴らす回数を表します (`Number`) + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iPhone +- Windows Phone 7 (Mango) +- Bada 1.2 & 2.x + +使用例 +------------- + + // 警告音を2回鳴らす + navigator.notification.beep(2); + +詳細な使用例 +------------ + + + + + Notification の使用例 + + + + + +

通知を表示

+

警告音を鳴らす

+

バイブレーション

+ + + +Android に関する注意点 +-------------- + +- Android では、 "Settings/Sound & Display" パネルで設定されたデフォルトの "Notification ringtone" を鳴らします。 + +iPhone に関する注意点 +------------- + +- 引数の警告音の回数を無視します。 +- iPhone はネイティブの beep API を持っていません。 +- Cordova は media API を使って、オーディオファイルを再生することで警告音を実装しています。 +- ユーザーは適切な警告音のファイルを用意する必要があります。 +- このファイルは30秒未満とし、 www/root に beep.wav として保存してください。 + +Windows Phone 7 に関する注意点 +------------- + +- WP7 の Cordova ライブラリは独自の警告音ファイルを含んでおり、それを使用しています。 http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/notification/notification.confirm.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/notification/notification.confirm.md b/docs/jp/2.1.0/cordova/notification/notification.confirm.md new file mode 100755 index 0000000..ab249b9 --- /dev/null +++ b/docs/jp/2.1.0/cordova/notification/notification.confirm.md @@ -0,0 +1,133 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +notification.confirm +==================== + +カスタマイズ可能な確認ダイアログボックスを表示します。 + + navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels]) + +- __message:__ ダイアログのメッセージを表します (`String`) +- __confirmCallback:__ 押されたボタンのインデックス (1, 2, または3) とともに呼び出されるコールバック関数を表します (`Function`) +- __title:__ ダイアログのタイトルを表します (`String`) (オプション, デフォルト: "Confirm") +- __buttonLabels:__ ボタンのラベルを設定するためのカンマ区切りの文字列を表します (String) (オプション, デフォルト: "OK,Cancel") + +概要 +----------- + +`notification.confirm` 関数は、ブラウザの confirm 関数よりも広いカスタマイズ性を持ったネイティブダイアログボックスを表示する関数です。 + +confirmCallback +--------------- + +`confirmCallback` はユーザーが確認ダイアログのいずれかのボタンが押したときに呼び出されます。 + +コールバックは、押されたボタンを表すインデックス `buttonIndex` (`Number`) を引数にとります。このインデックスは、 `1`, `2`, `3` のように1始まりであることに注意してください。 + + +サポートされているプラットフォーム +------------------- + +- Android +- BlackBerry WebWorks (OS 5.0 以上) +- iPhone +- Windows Phone 7 (Mango) +- Bada 1.2 & 2.x + +使用例 +------------- + + // 確認ダイアログの表示プロセスの開始 + function onConfirm(buttonIndex) { + alert('選択されたボタン ' + buttonIndex); + } + + // カスタム確認ダイアログを表示 + // + function showConfirm() { + navigator.notification.confirm( + 'あなたの勝ちです!', // メッセージ + onConfirm, // 選択されたボタン情報とともに呼ばれるコールバック関数 + 'ゲームオーバー', // タイトル + 'リスタート,終了' // ボタン + ); + } + +詳細な使用例 +------------ + + + + + Notification の使用例 + + + + + +

確認ダイアログを表示

+ + + +Windows Phone 7 に関する注意点 +---------------------- + +- ボタンの名前は無視され、常に `'OK|Cancel'` が使用されます。 +- `window.confirm` に対応するビルトインのブラウザ確認ダイアログ機能はありません。 + - `window.confirm = navigator.notification.confirm;` と指定することによって、 `window.confirm` にこの関数をアサインできます。 +- 通知 (`alert`) と確認 (`confirm`) の呼び出しはノンブロッキングで、結果は非同期でのみ取得可能です。 + +Bada 2.x に関する注意点 +--------------- + +- 確認 (`confirm`) は、ブラウザのビルトイン `alert` 関数を使用します。 + +Bada 1.2 に関する注意点 +--------------- + +- ボタンの名前は無視され、常に `'OK|Cancel'` が使用されます。 http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4272ca34/docs/jp/2.1.0/cordova/notification/notification.md ---------------------------------------------------------------------- diff --git a/docs/jp/2.1.0/cordova/notification/notification.md b/docs/jp/2.1.0/cordova/notification/notification.md new file mode 100644 index 0000000..cd2f869 --- /dev/null +++ b/docs/jp/2.1.0/cordova/notification/notification.md @@ -0,0 +1,80 @@ +--- +license: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--- + +Notification +============ + +> 視覚、聴覚、触覚を用いたデバイス通知機能を提供します。 + +メソッド +------- + +- notification.alert +- notification.confirm +- notification.beep +- notification.vibrate + +パーミッション +----------- + +### Android + +#### app/res/xml/plugins.xml + + + +#### app/AndroidManifest.xml + + + +### Bada + +#### manifest.xml + + + SYSTEM_SERVICE + + +### BlackBerry WebWorks + +#### www/plugins.xml + + + +#### www/config.xml + + + +### iOS + +#### App/Supporting Files/Cordova.plist + + Plugins + + Notification + CDVNotification + + +### webOS + + パーミッションの設定は必要ありません。 + +### Windows Phone + + パーミッションの設定は必要ありません。