You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mw...@apache.org on 2013/09/10 19:36:51 UTC
[06/51] [abbrv] [partial] Move Japanese to docs/ja and Korean to
docs/ko.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/capture/MediaFile.getFormatData.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/capture/MediaFile.getFormatData.md b/docs/ja/2.2.0/cordova/media/capture/MediaFile.getFormatData.md
new file mode 100644
index 0000000..003a8cc
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/capture/MediaFile.getFormatData.md
@@ -0,0 +1,53 @@
+---
+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.
+---
+
+MediaFile.getFormatData
+=======================
+
+> メディアキャプチャーファイルのフォーマット情報を取得します。
+
+ mediaFile.getFormatData(
+ MediaFileDataSuccessCB successCallback,
+ [MediaFileDataErrorCB errorCallback]
+ );
+
+概要
+-----------
+
+この関数は、メディアファイルのフォーマット情報の取得を非同期で試みます。もし成功すれば、 MediaFileData オブジェクトを伴った MediaFileDataSuccessCB コールバック関数を呼び出します。もし失敗すれば、 MediaFileDataErrorCB コールバック関数を呼び出します。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+BlackBerry WebWorks に関する注意点
+--------------------------
+メディアファイルのフォーマット情報を提供する API はありません。従って、全ての MediaFileData オブジェクトはデフォルト値で返されます。詳しくは MediaFileData のドキュメントをご覧ください。
+
+Android に関する注意点
+--------------
+メディアファイルのフォーマット情報を取得する API は限定されています。従って、全ての MediaFileData のプロパティーがサポートされている訳ではありません。詳しくは MediaFileData のドキュメントをご覧ください。
+
+iOS に関する注意点
+----------
+メディアファイルのフォーマット情報を取得する API は限定されています。従って、全ての MediaFileData のプロパティーがサポートされている訳ではありません。詳しくは MediaFileData のドキュメントをご覧ください。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/capture/MediaFile.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/capture/MediaFile.md b/docs/ja/2.2.0/cordova/media/capture/MediaFile.md
new file mode 100644
index 0000000..0896e88
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/capture/MediaFile.md
@@ -0,0 +1,37 @@
+---
+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.
+---
+
+MediaFile
+=========
+
+> メディアキャプチャーファイルのプロパティーをカプセル化します。
+
+プロパティー
+----------
+
+- __name:__ パス情報を含まないファイルの名前を表します。 (DOMString)
+- __fullPath:__ ファイルの名前を含むフルパスを表します。 (DOMString)
+- __type:__ ファイルの mime type を表します。 (DOMString)
+- __lastModifiedDate:__ ファイルの最終更新日時を表します。 (Date)
+- __size:__ ファイルのサイズをバイトで表します。 (Number)
+
+メソッド
+-------
+
+- __MediaFile.getFormatData:__ メディアファイルのフォーマット情報を取得します。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/capture/MediaFileData.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/capture/MediaFileData.md b/docs/ja/2.2.0/cordova/media/capture/MediaFileData.md
new file mode 100644
index 0000000..b209551
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/capture/MediaFileData.md
@@ -0,0 +1,62 @@
+---
+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.
+---
+
+MediaFileData
+=============
+
+> メディアファイルのフォーマット情報をカプセル化します。
+
+プロパティー
+----------
+
+- __codecs:__ オーディオやビデオの実際のフォーマットを表します。 (DOMString)
+- __bitrate:__ ファイルの平均ビットレートを表します。画像の場合は、0に設定されます。 (Number)
+- __height:__ 画像またはビデオの高さをピクセルで表します。オーディオの場合は、0に設定されます。 (Number)
+- __width:__ 画像またはビデオの幅をピクセルで表します。オーディオの場合は、0に設定されます。 (Number)
+- __duration:__ ビデオまたはオーディオの長さを秒で表します。画像の場合は、0に設定されます。 (Number)
+
+BlackBerry WebWorks に関する注意点
+--------------------------
+メディアファイルのフォーマット情報を提供する API はありません。 MediaFileData オブジェクトは、 MediaFile.getFormatData 関数によって返され、以下のようなデフォルト値を持ちます:
+
+- __codecs:__ サポートされていません。この属性は常に null となります。
+- __bitrate:__ サポートされていません。この属性は常に0となります。
+- __height:__ サポートされていません。この属性は常に0となります。
+- __width:__ サポートされていません。この属性は常に0となります。
+- __duration:__ サポートされていません。この属性は常に0となります。
+
+Android に関する注意点
+--------------
+MediaFileData プロパティーへのサポートは以下のとおりです:
+
+- __codecs:__ サポートされていません。この属性は常に null となります。
+- __bitrate:__ サポートされていません。この属性は常に0となります。
+- __height:__ サポートされています。 (画像及びビデオに限る) 。
+- __width:__ サポートされています。 (画像及びビデオに限る) 。
+- __duration:__ サポートされています。 (オーディオ及びビデオに限る) 。
+
+iOS に関する注意点
+----------
+MediaFileData プロパティーへのサポートは以下のとおりです:
+
+- __codecs:__ サポートされていません。この属性は常に null となります。
+- __bitrate:__ iOS4 のデバイスにおいて、オーディオのみサポートされています。この属性は、画像とビデオについては常に0となります。
+- __height:__ サポートされています。 (画像及びビデオに限る) 。
+- __width:__ サポートされています。 (画像及びビデオに限る) 。
+- __duration:__ サポートされています。 (オーディオ及びビデオに限る) 。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/capture/capture.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/capture/capture.md b/docs/ja/2.2.0/cordova/media/capture/capture.md
new file mode 100644
index 0000000..4c05d43
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/capture/capture.md
@@ -0,0 +1,134 @@
+---
+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
+=======
+
+> デバイスのオーディオ、イメージ、ビデオキャプチャー機能への制御を提供します。
+
+オブジェクト
+-------
+
+- Capture
+- CaptureAudioOptions
+- CaptureImageOptions
+- CaptureVideoOptions
+- CaptureCB
+- CaptureErrorCB
+- ConfigurationData
+- MediaFile
+- MediaFileData
+
+メソッド
+-------
+
+- capture.captureAudio
+- capture.captureImage
+- capture.captureVideo
+- MediaFile.getFormatData
+
+スコープ
+-----
+
+__capture__ オブジェクトは __navigator.device__ オブジェクトに割り当てられており、そのためグローバルスコープです。
+
+ // グローバル capture オブジェクト
+ var capture = navigator.device.capture;
+
+プロパティー
+----------
+
+- __supportedAudioModes:__ デバイスによってサポートされているオーディオ録音のフォーマットです。 (ConfigurationData[])
+- __supportedImageModes:__ デバイスによってサポートされている記録用の画像サイズやフォーマットです。 (ConfigurationData[])
+- __supportedVideoModes:__ デバイスによってサポートされている記録用のビデオ解像度やフォーマットです。 (ConfigurationData[])
+
+メソッド
+-------
+
+- capture.captureAudio: オーディオ録音のために、デバイスのオーディオ録音アプリを起動します。
+- capture.captureImage: 画像取得のために、デバイスのカメラアプリを起動します。
+- capture.captureVideo: ビデオ録画のために、デバイスのビデオ録画アプリを起動します。
+
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+パーミッション
+-----------
+
+### Android
+
+#### app/res/xml/plugins.xml
+
+ <plugin name="Capture" value="org.apache.cordova.Capture"/>
+
+#### app/AndroidManifest.xml
+
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+
+### Bada
+
+#### manifest.xml
+
+ <Privilege>
+ <Name>RECORDING</Name>
+ </Privilege>
+
+### BlackBerry WebWorks
+
+#### www/plugins.xml
+
+ <plugin name="Capture" value="org.apache.cordova.capture.MediaCapture" />
+
+#### www/config.xml
+
+ <feature id="blackberry.system" required="true" version="1.0.0.0" />
+ <feature id="blackberry.io.file" required="true" version="1.0.0.0" />
+
+### iOS
+
+#### App/Supporting Files/Cordova.plist
+
+ <key>Plugins</key>
+ <dict>
+ <key>Capture</key>
+ <string>CDVCapture</string>
+ </dict>
+
+### webOS
+
+ パーミッションの設定は必要ありません。
+
+### Windows Phone
+
+#### Properties/WPAppManifest.xml
+
+ <Capabilities>
+ <Capability Name="ID_CAP_MEDIALIB" />
+ <Capability Name="ID_CAP_MICROPHONE" />
+ <Capability Name="ID_HW_FRONTCAMERA" />
+ <Capability Name="ID_CAP_ISV_CAMERA" />
+ <Capability Name="ID_CAP_CAMERA" />
+ </Capabilities>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/capture/captureAudio.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/capture/captureAudio.md b/docs/ja/2.2.0/cordova/media/capture/captureAudio.md
new file mode 100644
index 0000000..6a97fc6
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/capture/captureAudio.md
@@ -0,0 +1,140 @@
+---
+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.captureAudio
+====================
+
+> オーディオ録音アプリを起動し、キャプチャーしたファイルの情報を返します。
+
+ navigator.device.capture.captureAudio(
+ CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureAudioOptions options]
+ );
+
+概要
+-----------
+
+このメソッドは、デバイスのデフォルトのオーディオ録音アプリを使用して、オーディオをキャプチャーするための非同期操作を開始します。この操作はユーザーに、単一セッションで複数のビデオのキャプチャーをユーザーに許可します。
+
+キャプチャー操作は、ユーザーがオーディオ録音アプリを終了するか、 CaptureAudioOptions の中の __limit__ パラメーターで指定された最大録音回数に達した場合に終了します。もし __limit__ パラメーターが指定されていない場合は、デフォルト値である1が使用され、キャプチャー操作はユーザーが1度オーディオを録音した後に終了します。
+
+キャプチャー操作が終了した時、それぞれのオーディオ録音ファイル情報が書かれた MediaFile オブジェクトの配列を伴った CaptureCB コールバック関数を呼び出します。もしオーディオがキャプチャーされる前にユーザーによって操作が終了されたら、 CaptureError.`CAPTURE_NO_MEDIA_FILES` エラーコードを持つ CaptureError オブジェクトを伴った CaptureErrorCB コールバック関数が呼び出されます。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+使用例
+-------------
+
+ // 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.captureAudio(captureSuccess, captureError, {limit:2});
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>オーディオキャプチャー</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8" src="json2.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // キャプチャー操作の正常終了時の処理
+ //
+ function captureSuccess(mediaFiles) {
+ var i, len;
+ for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+ uploadFile(mediaFiles[i]);
+ }
+ }
+
+ // エラー発生時の処理
+ //
+ function captureError(error) {
+ var msg = 'キャプチャー中にエラーが発生しました: ' + error.code;
+ navigator.notification.alert(msg, null, 'エラー');
+ }
+
+ // ボタンがクリックされた場合の処理
+ //
+ function captureAudio() {
+ // デバイスのオーディオ録音アプリを起動し、
+ // ユーザーに2つまでオーディオの録音を許可する
+ navigator.device.capture.captureAudio(captureSuccess, captureError, {limit: 2});
+ }
+
+ // ファイルをサーバーにアップロード
+ function uploadFile(mediaFile) {
+ var ft = new FileTransfer(),
+ path = mediaFile.fullPath,
+ name = mediaFile.name;
+
+ ft.upload(path,
+ "http://my.domain.com/upload.php",
+ function(result) {
+ console.log('アップロード成功: ' + result.responseCode);
+ console.log(result.bytesSent + ' バイト送信');
+ },
+ function(error) {
+ console.log('ファイルのアップロードに失敗 ' + path + ': ' + error.code);
+ },
+ { fileName: name });
+ }
+
+ </script>
+ </head>
+ <body>
+ <button onclick="captureAudio();">オーディオキャプチャー</button> <br>
+ </body>
+ </html>
+
+BlackBerry WebWorks に関する注意点
+--------------------------
+
+- Cordova for BlackBerry WebWorks は、オーディオ録音のために RIM より提供されている __Voice Notes Recorder__ の起動を試みます。デベロッパーは、もしアプリがインストールされていない場合は CaptureError.`CAPTURE_NOT_SUPPORTED` エラーを受け取ります。
+
+iOS に関する注意点
+----------
+
+- iOS にはデフォルトのオーディオ録音アプリがないため、シンプルなユーザーインターフェースが提供されます。
+
+Windows Phone 7 に関する注意点
+----------
+
+- Windows Phone 7 にはデフォルトのオーディオ録音アプリがないため、シンプルなユーザーインターフェースが提供されます。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/capture/captureAudioOptions.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/capture/captureAudioOptions.md b/docs/ja/2.2.0/cordova/media/capture/captureAudioOptions.md
new file mode 100644
index 0000000..a2d27b9
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/capture/captureAudioOptions.md
@@ -0,0 +1,56 @@
+---
+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.
+---
+
+CaptureAudioOptions
+===================
+
+> オーディオキャプチャーのオプションをカプセル化します。
+
+プロパティー
+----------
+
+- __limit:__ 一つのキャプチャー操作で録音できるオーディオクリップの最大値を表します。値は1以上の必要があります (デフォルトは1です) 。
+- __duration:__ オーディオクリップの最大録音時間を秒で表します。
+- __mode:__ 選択されたオーディオのモードを表します。値は `capture.supportedAudioModes` の中の一つである必要があります。
+
+使用例
+-------------
+
+ // キャプチャー操作時のオーディオクリップの最大値を3に制限、最大録音時間を10秒に設定
+ var options = { limit: 3, duration: 10 };
+
+ navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+
+Android に関する注意点
+--------------
+
+- __duration__ パラメーターはサポートされていません。録画時間をプログラム的に制限することは出来ません。
+- __mode__ パラメーターはサポートされていません。録音のフォーマットをプログラム的に変更することは出来ません。録音は Adaptive Multi-Rate (AMR) フォーマット (audio/amr) を使用してエンコードされます。
+
+BlackBerry WebWorks に関する注意点
+--------------------------
+
+- __duration__ パラメーターはサポートされていません。録画時間をプログラム的に制限することは出来ません。
+- __mode__ パラメーターはサポートされていません。録音のフォーマットをプログラム的に変更することは出来ません。録音は Adaptive Multi-Rate (AMR) フォーマット (audio/amr) を使用してエンコードされます。
+
+iOS に関する注意点
+----------
+
+- __limit__ パラメーターはサポートされていません。1つのキャプチャー操作につき1つの録音が作られます。
+- __mode__ パラメーターはサポートされていません。録音のフォーマットをプログラム的に変更することは出来ません。録音は Waveform Audio (WAV) フォーマット (audio/wav) を使用してエンコードされます。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/capture/captureImage.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/capture/captureImage.md b/docs/ja/2.2.0/cordova/media/capture/captureImage.md
new file mode 100644
index 0000000..a7b9540
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/capture/captureImage.md
@@ -0,0 +1,158 @@
+---
+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.captureImage
+====================
+
+> カメラアプリを起動し、キャプチャーしたファイルの情報を返します。
+
+ navigator.device.capture.captureImage(
+ CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+ );
+
+概要
+-----------
+
+このメソッドは、デバイスのカメラアプリを使用して、画像をキャプチャーするための非同期操作を開始します。この操作はユーザーに、単一セッションで複数の画像のキャプチャーをユーザーに許可します。
+
+キャプチャー操作は、ユーザーがカメラアプリを終了するか、 CaptureImageOption の中の __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
+
+Windows Phone 7 に関する注意点
+----------------------
+
+Zune とデバイスが接続している間は、ネイティブカメラアプリケーションは
+起動せずに、エラーコールバックが呼び出されます。
+
+使用例
+-------------
+
+ // 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.captureImage(captureSuccess, captureError, {limit:2});
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>画像キャプチャー</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8" src="json2.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // キャプチャー操作の正常終了時の処理
+ //
+ function captureSuccess(mediaFiles) {
+ var i, len;
+ for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+ uploadFile(mediaFiles[i]);
+ }
+ }
+
+ // エラー発生時の処理
+ //
+ function captureError(error) {
+ var msg = 'キャプチャー中にエラーが発生しました: ' + error.code;
+ navigator.notification.alert(msg, null, 'エラー');
+ }
+
+ // ボタンがクリックされた場合の処理
+ //
+ function captureImage() {
+ // デバイスのカメラアプリを起動、
+ // ユーザーに2つまで画像のキャプチャーを許可する
+ navigator.device.capture.captureImage(captureSuccess, captureError, {limit: 2});
+ }
+
+ // ファイルをサーバーにアップロード
+ function uploadFile(mediaFile) {
+ var ft = new FileTransfer(),
+ path = mediaFile.fullPath,
+ name = mediaFile.name;
+
+ ft.upload(path,
+ "http://my.domain.com/upload.php",
+ function(result) {
+ console.log('アップロード成功: ' + result.responseCode);
+ console.log(result.bytesSent + ' バイト送信');
+ },
+ function(error) {
+ console.log('ファイルのアップロードに失敗 ' + path + ': ' + error.code);
+ },
+ { fileName: name });
+ }
+
+ </script>
+ </head>
+ <body>
+ <button onclick="captureImage();">画像キャプチャー</button> <br>
+ </body>
+ </html>
+
+
+Bada に関する注意点
+-----------
+
+Bada は _captureImage_ を他のデバイスと同様にサポートします。しかしながら、カメラアプリを起動せずにビデオや画像を webview 内でキャプチャー出来る _別の_ モードが存在します。このモードを使うためには、以下の手順が必要です:
+
+1. _<div>_ 要素をドキュメントのどこかに作成し、 "preview" といったような id を付与します
+
+ <div id="preview"></div>
+
+2. カメラプレビューを以下のメソッドで初期化します
+
+ navigator.camera.showPreview("preview");
+
+3. プレビューを取得した後、以下のことが可能です
+
+ 3.1 画像をキャプチャー
+
+ var options = { destinationFilename: "images/cam01.jpg", highRes: false};
+ navigator.capture.captureImage(success, fail, options);
+
+3. 以下のメソッドでカメラプレビュー画面を隠します
+
+ navigator.camera.hidePreview("preview");
+
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/capture/captureImageOptions.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/capture/captureImageOptions.md b/docs/ja/2.2.0/cordova/media/capture/captureImageOptions.md
new file mode 100644
index 0000000..45b3298
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/capture/captureImageOptions.md
@@ -0,0 +1,53 @@
+---
+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.
+---
+
+CaptureImageOptions
+===================
+
+> 画像キャプチャーのオプションをカプセル化します。
+
+プロパティー
+----------
+
+- __limit:__ 一つのキャプチャー操作で撮影できる画像の最大値を表します。値は1以上の必要があります (デフォルトは1です) 。
+- __mode:__ 選択された画像のモードを表します。値は `capture.supportedImageModes` の中の一つである必要があります。
+
+使用例
+-------------
+
+ // キャプチャー操作時の取得画像の最大値を3に制限
+ var options = { limit: 3 };
+
+ navigator.device.capture.captureImage(captureSuccess, captureError, options);
+
+Android に関する注意点
+--------------
+
+- __mode__ パラメーターはサポートされていません。画像のサイズとフォーマットはプログラム的に変更することはできません。しかし、画像サイズはユーザーによって変更することは可能です。画像は JPEG フォーマット (image/jpeg) で保存されます。
+
+BlackBerry WebWorks に関する注意点
+--------------------------
+
+- __mode__ パラメーターはサポートされていません。画像のサイズとフォーマットはプログラム的に変更することはできません。しかし、画像サイズはユーザーによって変更することは可能です。画像は JPEG フォーマット (image/jpeg) で保存されます。
+
+iOS に関する注意点
+----------
+
+- __limit__ パラメーターはサポートされていません。1つのキャプチャー操作につき1つの画像が撮影されます。
+- __mode__ パラメーターはサポートされていません。画像のサイズとフォーマットはプログラム的に変更することはできません。画像は JPEG フォーマット (image/jpeg) で保存されます。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/capture/captureVideo.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/capture/captureVideo.md b/docs/ja/2.2.0/cordova/media/capture/captureVideo.md
new file mode 100644
index 0000000..76b0153
--- /dev/null
+++ b/docs/ja/2.2.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});
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>ビデオキャプチャー</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8" src="json2.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // キャプチャー操作の正常終了時の処理
+ //
+ function captureSuccess(mediaFiles) {
+ var i, len;
+ for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+ uploadFile(mediaFiles[i]);
+ }
+ }
+
+ // エラー発生時の処理
+ //
+ function captureError(error) {
+ var msg = 'キャプチャー中にエラーが発生しました: ' + error.code;
+ navigator.notification.alert(msg, null, 'エラー');
+ }
+
+ // ボタンがクリックされた場合の処理
+ //
+ function captureVideo() {
+ // デバイスのビデオ録画アプリを起動し、
+ // ユーザーに2つまでビデオの録画を許可する
+ navigator.device.capture.captureVideo(captureSuccess, captureError, {limit: 2});
+ }
+
+ // ファイルをサーバーにアップロード
+ function uploadFile(mediaFile) {
+ var ft = new FileTransfer(),
+ path = mediaFile.fullPath,
+ name = mediaFile.name;
+
+ ft.upload(path,
+ "http://my.domain.com/upload.php",
+ function(result) {
+ console.log('アップロード成功: ' + result.responseCode);
+ console.log(result.bytesSent + ' バイト送信');
+ },
+ function(error) {
+ console.log('ファイルのアップロードに失敗 ' + path + ': ' + error.code);
+ },
+ { fileName: name });
+ }
+
+ </script>
+ </head>
+ <body>
+ <button onclick="captureVideo();">ビデオキャプチャー</button> <br>
+ </body>
+ </html>
+
+BlackBerry WebWorks に関する注意点
+--------------------------
+
+- Cordova for BlackBerry WebWorks は、ビデオ録画のために RIM より提供されている __Video Recorder__ の起動を試みます。デベロッパーは、もしアプリがインストールされていない場合は CaptureError.`CAPTURE_NOT_SUPPORTED` エラーを受け取ります。
+
+Bada 2.x に関する注意点
+---------------
+
+Bada は _captureVideo_ を他のデバイスと同様にサポートします。しかしながら、カメラアプリを起動せずにビデオや画像を webview 内でキャプチャー出来る _別の_ モードが存在します。このモードを使うためには、以下の手順が必要です:
+
+1. _<div>_ 要素をドキュメントのどこかに作成し、 "preview" といったような id を付与します
+
+ <div id="preview"></div>
+
+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/e7168dd7/docs/ja/2.2.0/cordova/media/capture/captureVideoOptions.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/capture/captureVideoOptions.md b/docs/ja/2.2.0/cordova/media/capture/captureVideoOptions.md
new file mode 100644
index 0000000..0d1b7f5
--- /dev/null
+++ b/docs/ja/2.2.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/e7168dd7/docs/ja/2.2.0/cordova/media/media.getCurrentPosition.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/media.getCurrentPosition.md b/docs/ja/2.2.0/cordova/media/media.getCurrentPosition.md
new file mode 100644
index 0000000..8f14ff1
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/media.getCurrentPosition.md
@@ -0,0 +1,174 @@
+---
+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)
+- Tizen
+
+使用例
+-------------
+
+ // オーディオプレイヤー
+ //
+ 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);
+
+
+詳細な使用例
+------------
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>メディアの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // オーディオプレイヤー
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // オーディオ再生
+ //
+ function playAudio(src) {
+ // src から Media オブジェクトを作成
+ my_media = new Media(src, onSuccess, onError);
+
+ // オーディオ再生
+ my_media.play();
+
+ // my_media の再生位置を一秒ごとに更新
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // my_media の再生位置を取得
+ my_media.getCurrentPosition(
+ // 呼び出し成功
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // 呼び出し失敗
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // オーディオ一時停止
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // オーディオ停止
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">再生</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">一時停止</a>
+ <a href="#" class="btn large" onclick="stopAudio();">停止</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/media.getDuration.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/media.getDuration.md b/docs/ja/2.2.0/cordova/media/media.getDuration.md
new file mode 100644
index 0000000..f54247a
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/media.getDuration.md
@@ -0,0 +1,166 @@
+---
+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)
+- Tizen
+
+使用例
+-------------
+
+ // オーディオプレイヤー
+ //
+ 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);
+
+
+詳細な使用例
+------------
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>メディアの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // オーディオプレイヤー
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // オーディオ再生
+ //
+ function playAudio(src) {
+ // src から Media オブジェクトを作成
+ my_media = new Media(src, onSuccess, onError);
+
+ // オーディオ再生
+ my_media.play();
+
+ // my_media の再生位置を一秒ごとに更新
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // my_media の再生位置を取得
+ my_media.getCurrentPosition(
+ // 呼び出し成功
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // 呼び出し失敗
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // オーディオ一時停止
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // オーディオ停止
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">再生</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">一時停止</a>
+ <a href="#" class="btn large" onclick="stopAudio();">停止</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/media.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/media.md b/docs/ja/2.2.0/cordova/media/media.md
new file mode 100644
index 0000000..701bf7c
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/media.md
@@ -0,0 +1,142 @@
+---
+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)_
+
+定数
+---------
+
+以下の定数は __mediaStatus__ コールバック関数への引数としてのみ使用されます。
+
+- `Media.MEDIA_NONE` = 0;
+- `Media.MEDIA_STARTING` = 1;
+- `Media.MEDIA_RUNNING` = 2;
+- `Media.MEDIA_PAUSED` = 3;
+- `Media.MEDIA_STOPPED` = 4;
+
+メソッド
+-------
+
+- 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.5
+- Tizen
+
+パーミッション
+-----------
+
+### Android
+
+#### app/res/xml/config.xml
+
+ <plugin name="Media" value="org.apache.cordova.AudioHandler" />
+
+#### app/AndroidManifest.xml
+
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
+ <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+
+### Bada
+
+#### manifest.xml
+
+ <Privilege>
+ <Name>RECORDING</Name>
+ </Privilege>
+
+### BlackBerry WebWorks
+
+#### www/plugins.xml
+
+ <plugin name="Capture" value="org.apache.cordova.media.MediaCapture" />
+
+### iOS
+
+#### App/Supporting Files/Cordova.plist
+
+ <key>Plugins</key>
+ <dict>
+ <key>Media</key>
+ <string>CDVSound</string>
+ </dict>
+
+### webOS
+
+ パーミッションの設定は必要ありません。
+
+### Windows Phone
+
+#### Properties/WPAppManifest.xml
+
+ <Capabilities>
+ <Capability Name="ID_CAP_MEDIALIB" />
+ <Capability Name="ID_CAP_MICROPHONE" />
+ <Capability Name="ID_HW_FRONTCAMERA" />
+ <Capability Name="ID_CAP_ISV_CAMERA" />
+ <Capability Name="ID_CAP_CAMERA" />
+ </Capabilities>
+
+参照: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx)
+
+### Tizen
+
+ パーミッションの設定は必要ありません。
+
+
+### Windows Phone に関する注意点
+ 一度に一つのメディアファイルのみ再生できます。
+ アプリケーションが他のメディアとどのように関わるかには、厳しい制限があります。詳しくは http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh184838(v=vs.92).aspx を参照してください。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/media.pause.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/media.pause.md b/docs/ja/2.2.0/cordova/media/media.pause.md
new file mode 100644
index 0000000..2443e0c
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/media.pause.md
@@ -0,0 +1,170 @@
+---
+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)
+- Tizen
+
+使用例
+-------------
+
+ // オーディオ再生
+ //
+ 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);
+ }
+
+詳細な使用例
+------------
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>メディアの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // オーディオプレイヤー
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // オーディオ再生
+ //
+ function playAudio(src) {
+ // src から Media オブジェクトを作成
+ my_media = new Media(src, onSuccess, onError);
+
+ // オーディオ再生
+ my_media.play();
+
+ // my_media の再生位置を一秒ごとに更新
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // my_media の再生位置を取得
+ my_media.getCurrentPosition(
+ // 呼び出し成功
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // 呼び出し失敗
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // オーディオ一時停止
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // オーディオ停止
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">再生</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">一時停止</a>
+ <a href="#" class="btn large" onclick="stopAudio();">停止</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/media/media.play.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/media.play.md b/docs/ja/2.2.0/cordova/media/media.play.md
new file mode 100644
index 0000000..a501d2b
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/media.play.md
@@ -0,0 +1,189 @@
+---
+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)
+- Tizen
+
+使用例
+-------------
+
+ // オーディオ再生
+ //
+ 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();
+ }
+
+
+詳細な使用例
+------------
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>メディアの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // オーディオプレイヤー
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // オーディオ再生
+ //
+ function playAudio(src) {
+ if (my_media == null) {
+ // src から Media オブジェクトを作成
+ my_media = new Media(src, onSuccess, onError);
+ } // else 現在のオーディオを再生
+ // オーディオ再生
+ my_media.play();
+
+ // my_media の再生位置を一秒ごとに更新
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // my_media の再生位置を取得
+ my_media.getCurrentPosition(
+ // 呼び出し成功
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // 呼び出し失敗
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // オーディオ一時停止
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // オーディオ停止
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">再生</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">一時停止</a>
+ <a href="#" class="btn large" onclick="stopAudio();">停止</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
+
+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/e7168dd7/docs/ja/2.2.0/cordova/media/media.release.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/media/media.release.md b/docs/ja/2.2.0/cordova/media/media.release.md
new file mode 100644
index 0000000..0e7b629
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/media/media.release.md
@@ -0,0 +1,155 @@
+---
+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)
+- Tizen
+
+使用例
+-------------
+
+ // オーディオプレイヤー
+ //
+ var my_media = new Media(src, onSuccess, onError);
+
+ my_media.play();
+ my_media.stop();
+ my_media.release();
+
+詳細な使用例
+------------
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>メディアの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // オーディオプレイヤー
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // オーディオ再生
+ //
+ function playAudio(src) {
+ // src から Media オブジェクトを作成
+ my_media = new Media(src, onSuccess, onError);
+
+ // オーディオ再生
+ my_media.play();
+
+ // my_media の再生位置を一秒ごとに更新
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // my_media の再生位置を取得
+ my_media.getCurrentPosition(
+ // 呼び出し成功
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // 呼び出し失敗
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // オーディオ一時停止
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // オーディオ停止
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // 成功時のコールバック関数
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // エラー時のコールバック関数
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ // 再生位置をセット
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">再生</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">一時停止</a>
+ <a href="#" class="btn large" onclick="stopAudio();">停止</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>