You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/12/19 04:01:12 UTC
[2/7] CB-5658 Delete plugin API reference in favour of links to
github doc/index.md files
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/capture/captureAudio.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/capture/captureAudio.md b/docs/en/edge/cordova/media/capture/captureAudio.md
deleted file mode 100644
index 9e4f3c4..0000000
--- a/docs/en/edge/cordova/media/capture/captureAudio.md
+++ /dev/null
@@ -1,145 +0,0 @@
----
-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
-
-> Start the audio recorder application and return information about captured audio clip files.
-
- navigator.device.capture.captureAudio(
- CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureAudioOptions options]
- );
-
-## Description
-
-Starts an asynchronous operation to capture audio recordings using the
-device's default audio recording application. The operation allows
-the device user to capture multiple recordings in a single session.
-
-The capture operation ends when either the user exits the audio
-recording application, or the maximum number of recordings specified
-by `CaptureAudioOptions.limit` is reached. If no `limit` parameter
-value is specified, it defaults to one (1), and the capture operation
-terminates after the user records a single audio clip.
-
-When the capture operation finishes, the `CaptureCallback` executes
-with an array of `MediaFile` objects describing each captured audio
-clip file. If the user terminates the operation before an audio clip
-is captured, the `CaptureErrorCallback` executes with a `CaptureError`
-object, featuring the `CaptureError.CAPTURE_NO_MEDIA_FILES` error
-code.
-
-## Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- iOS
-- Windows Phone 7 and 8
-- Windows 8
-
-## Quick Example
-
- // capture callback
- var captureSuccess = function(mediaFiles) {
- var i, path, len;
- for (i = 0, len = mediaFiles.length; i < len; i += 1) {
- path = mediaFiles[i].fullPath;
- // do something interesting with the file
- }
- };
-
- // capture error callback
- var captureError = function(error) {
- navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
- };
-
- // start audio capture
- navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
-
-## Full Example
-
- <!DOCTYPE html>
- <html>
- <head>
- <title>Capture Audio</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8" src="json2.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Called when capture operation is finished
- //
- function captureSuccess(mediaFiles) {
- var i, len;
- for (i = 0, len = mediaFiles.length; i < len; i += 1) {
- uploadFile(mediaFiles[i]);
- }
- }
-
- // Called if something bad happens.
- //
- function captureError(error) {
- var msg = 'An error occurred during capture: ' + error.code;
- navigator.notification.alert(msg, null, 'Uh oh!');
- }
-
- // A button will call this function
- //
- function captureAudio() {
- // Launch device audio recording application,
- // allowing user to capture up to 2 audio clips
- navigator.device.capture.captureAudio(captureSuccess, captureError, {limit: 2});
- }
-
- // Upload files to server
- 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('Upload success: ' + result.responseCode);
- console.log(result.bytesSent + ' bytes sent');
- },
- function(error) {
- console.log('Error uploading file ' + path + ': ' + error.code);
- },
- { fileName: name });
- }
-
- </script>
- </head>
- <body>
- <button onclick="captureAudio();">Capture Audio</button> <br>
- </body>
- </html>
-
-## BlackBerry 10 Quirks
-
-- Cordova for BlackBerry 10 attempts to launch the __Voice Notes Recorder__ application, provided by RIM, to capture audio recordings. The app receives a `CaptureError.CAPTURE_NOT_SUPPORTED` error code if the application is not installed on the device.
-
-## iOS Quirks
-
-- iOS does not have a default audio recording application, so a simple user interface is provided.
-
-## Windows Phone 7 and 8 Quirks
-
-- Windows Phone 7 does not have a default audio recording application, so a simple user interface is provided.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/capture/captureAudioOptions.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/capture/captureAudioOptions.md b/docs/en/edge/cordova/media/capture/captureAudioOptions.md
deleted file mode 100644
index daf3459..0000000
--- a/docs/en/edge/cordova/media/capture/captureAudioOptions.md
+++ /dev/null
@@ -1,51 +0,0 @@
----
-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
-
-> Encapsulates audio capture configuration options.
-
-## Properties
-
-- __limit__: The maximum number of audio clips the device user can record in a single capture operation. The value must be greater than or equal to 1 (defaults to 1).
-
-- __duration__: The maximum duration of an audio sound clip, in seconds.
-
-## Quick Example
-
- // limit capture operation to 3 media files, no longer than 10 seconds each
- var options = { limit: 3, duration: 10 };
-
- navigator.device.capture.captureAudio(captureSuccess, captureError, options);
-
-## Amazon Fire OS Quirks
-
-- The `duration` parameter is not supported. Recording lengths cannot be limited programmatically.
-
-## Android Quirks
-
-- The `duration` parameter is not supported. Recording lengths can't be limited programmatically.
-
-## BlackBerry 10 Quirks
-
-- The `duration` parameter is not supported. Recording lengths can't be limited programmatically.
-
-## iOS Quirks
-
-- The `limit` parameter is not supported, so only one recording can be created for each invocation.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/capture/captureImage.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/capture/captureImage.md b/docs/en/edge/cordova/media/capture/captureImage.md
deleted file mode 100644
index d7660c4..0000000
--- a/docs/en/edge/cordova/media/capture/captureImage.md
+++ /dev/null
@@ -1,138 +0,0 @@
----
-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
-
-> Start the camera application and return information about captured image files.
-
- navigator.device.capture.captureImage(
- CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
- );
-
-## Description
-
-Starts an asynchronous operation to capture images using the device's
-camera application. The operation allows users to capture more than
-one image in a single session.
-
-The capture operation ends either when the user closes the camera
-application, or the maximum number of recordings specified by
-`CaptureAudioOptions.limit` is reached. If no `limit` value is
-specified, it defaults to one (1), and the capture operation
-terminates after the user captures a single image.
-
-When the capture operation finishes, it invokes the `CaptureCB`
-callback with an array of `MediaFile` objects describing each captured
-image file. If the user terminates the operation before capturing an
-image, the `CaptureErrorCB` callback executes with a `CaptureError`
-object featuring a `CaptureError.CAPTURE_NO_MEDIA_FILES` error code.
-
-## Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- iOS
-- Windows Phone 7 and 8
-- Windows 8
-
-## Windows Phone 7 Quirks
-
-Invoking the native camera application while your device is connected
-via Zune does not work, and the error callback executes.
-
-## Quick Example
-
- // capture callback
- var captureSuccess = function(mediaFiles) {
- var i, path, len;
- for (i = 0, len = mediaFiles.length; i < len; i += 1) {
- path = mediaFiles[i].fullPath;
- // do something interesting with the file
- }
- };
-
- // capture error callback
- var captureError = function(error) {
- navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
- };
-
- // start image capture
- navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
-
-## Full Example
-
- <!DOCTYPE html>
- <html>
- <head>
- <title>Capture Image</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8" src="json2.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Called when capture operation is finished
- //
- function captureSuccess(mediaFiles) {
- var i, len;
- for (i = 0, len = mediaFiles.length; i < len; i += 1) {
- uploadFile(mediaFiles[i]);
- }
- }
-
- // Called if something bad happens.
- //
- function captureError(error) {
- var msg = 'An error occurred during capture: ' + error.code;
- navigator.notification.alert(msg, null, 'Uh oh!');
- }
-
- // A button will call this function
- //
- function captureImage() {
- // Launch device camera application,
- // allowing user to capture up to 2 images
- navigator.device.capture.captureImage(captureSuccess, captureError, {limit: 2});
- }
-
- // Upload files to server
- 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('Upload success: ' + result.responseCode);
- console.log(result.bytesSent + ' bytes sent');
- },
- function(error) {
- console.log('Error uploading file ' + path + ': ' + error.code);
- },
- { fileName: name });
- }
-
- </script>
- </head>
- <body>
- <button onclick="captureImage();">Capture Image</button> <br>
- </body>
- </html>
-
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/capture/captureImageOptions.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/capture/captureImageOptions.md b/docs/en/edge/cordova/media/capture/captureImageOptions.md
deleted file mode 100644
index 33d1144..0000000
--- a/docs/en/edge/cordova/media/capture/captureImageOptions.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-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
-
-> Encapsulates image capture configuration options.
-
-## Properties
-
-- __limit__: The maximum number of images the user can capture in a single capture operation. The value must be greater than or equal to 1 (defaults to 1).
-
-## Quick Example
-
- // limit capture operation to 3 images
- var options = { limit: 3 };
-
- navigator.device.capture.captureImage(captureSuccess, captureError, options);
-
-## iOS Quirks
-
-- The __limit__ parameter is not supported, and only one image is taken per invocation.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/capture/captureVideo.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/capture/captureVideo.md b/docs/en/edge/cordova/media/capture/captureVideo.md
deleted file mode 100644
index f9bf412..0000000
--- a/docs/en/edge/cordova/media/capture/captureVideo.md
+++ /dev/null
@@ -1,138 +0,0 @@
----
-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
-
-> Start the video recorder application and return information about captured video clip files.
-
- navigator.device.capture.captureVideo(
- CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
- );
-
-## Description
-
-Starts an asynchronous operation to capture video recordings using the
-device's video recording application. The operation allows the user
-to capture more than one recordings in a single session.
-
-The capture operation ends when either the user exits the video
-recording application, or the maximum number of recordings specified
-by `CaptureVideoOptions.limit` is reached. If no `limit` parameter
-value is specified, it defaults to one (1), and the capture operation
-terminates after the user records a single video clip.
-
-When the capture operation finishes, it the `CaptureCB` callback
-executes with an array of `MediaFile` objects describing each captured
-video clip file. If the user terminates the operation before
-capturing a video clip, the `CaptureErrorCB` callback executes with a
-`CaptureError` object featuring a
-`CaptureError.CAPTURE_NO_MEDIA_FILES` error code.
-
-## Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- iOS
-- Windows Phone 7 and 8
-- Windows 8
-
-## Quick Example
-
- // capture callback
- var captureSuccess = function(mediaFiles) {
- var i, path, len;
- for (i = 0, len = mediaFiles.length; i < len; i += 1) {
- path = mediaFiles[i].fullPath;
- // do something interesting with the file
- }
- };
-
- // capture error callback
- var captureError = function(error) {
- navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
- };
-
- // start video capture
- navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
-
-## Full Example
-
- <!DOCTYPE html>
- <html>
- <head>
- <title>Capture Video</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8" src="json2.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Called when capture operation is finished
- //
- function captureSuccess(mediaFiles) {
- var i, len;
- for (i = 0, len = mediaFiles.length; i < len; i += 1) {
- uploadFile(mediaFiles[i]);
- }
- }
-
- // Called if something bad happens.
- //
- function captureError(error) {
- var msg = 'An error occurred during capture: ' + error.code;
- navigator.notification.alert(msg, null, 'Uh oh!');
- }
-
- // A button will call this function
- //
- function captureVideo() {
- // Launch device video recording application,
- // allowing user to capture up to 2 video clips
- navigator.device.capture.captureVideo(captureSuccess, captureError, {limit: 2});
- }
-
- // Upload files to server
- 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('Upload success: ' + result.responseCode);
- console.log(result.bytesSent + ' bytes sent');
- },
- function(error) {
- console.log('Error uploading file ' + path + ': ' + error.code);
- },
- { fileName: name });
- }
-
- </script>
- </head>
- <body>
- <button onclick="captureVideo();">Capture Video</button> <br>
- </body>
- </html>
-
-## BlackBerry 10 Quirks
-
-- Cordova for BlackBerry 10 attempts to launch the __Video Recorder__ application, provided by RIM, to capture video recordings. The app receives a `CaptureError.CAPTURE_NOT_SUPPORTED` error code if the application is not installed on the device.
-
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/capture/captureVideoOptions.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/capture/captureVideoOptions.md b/docs/en/edge/cordova/media/capture/captureVideoOptions.md
deleted file mode 100644
index 920a469..0000000
--- a/docs/en/edge/cordova/media/capture/captureVideoOptions.md
+++ /dev/null
@@ -1,44 +0,0 @@
----
-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
-
-> Encapsulates video capture configuration options.
-
-## Properties
-
-- __limit__: The maximum number of video clips the device's user can capture in a single capture operation. The value must be greater than or equal to 1 (defaults to 1).
-
-- __duration__: The maximum duration of a video clip, in seconds.
-
-## Quick Example
-
- // limit capture operation to 3 video clips
- var options = { limit: 3 };
-
- navigator.device.capture.captureVideo(captureSuccess, captureError, options);
-
-## BlackBerry 10 Quirks
-
-- The __duration__ parameter is not supported, so the length of recordings can't be limited programmatically.
-
-## iOS Quirks
-
-- The __limit__ parameter is not supported. Only one video is recorded per invocation.
-
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/media.getCurrentPosition.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.getCurrentPosition.md b/docs/en/edge/cordova/media/media.getCurrentPosition.md
deleted file mode 100644
index 24b23dd..0000000
--- a/docs/en/edge/cordova/media/media.getCurrentPosition.md
+++ /dev/null
@@ -1,176 +0,0 @@
----
-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
-
-Returns the current position within an audio file.
-
- media.getCurrentPosition(mediaSuccess, [mediaError]);
-
-## Parameters
-
-- __mediaSuccess__: The callback that is passed the current position in seconds.
-
-- __mediaError__: (Optional) The callback to execute if an error occurs.
-
-## Description
-
-An asynchronous function that returns the current position of the
-underlying audio file of a `Media` object. Also updates the `Media`
-object's `position` parameter.
-
-## Supported Platforms
-
-- Android
-
-- BlackBerry 10
-
-- iOS
-
-- Windows Phone 7 and 8
-
-- Tizen
-
-- Windows 8
-
-## Quick Example
-
- // Audio player
- //
- var my_media = new Media(src, onSuccess, onError);
-
- // Update media position every second
- var mediaTimer = setInterval(function () {
- // get media position
- my_media.getCurrentPosition(
- // success callback
- function (position) {
- if (position > -1) {
- console.log((position) + " sec");
- }
- },
- // error callback
- function (e) {
- console.log("Error getting pos=" + e);
- }
- );
- }, 1000);
-
-## Full Example
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <title>Media Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for device API libraries to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // device APIs are available
- //
- function onDeviceReady() {
- playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
- }
-
- // Audio player
- //
- var my_media = null;
- var mediaTimer = null;
-
- // Play audio
- //
- function playAudio(src) {
- // Create Media object from src
- my_media = new Media(src, onSuccess, onError);
-
- // Play audio
- my_media.play();
-
- // Update my_media position every second
- if (mediaTimer == null) {
- mediaTimer = setInterval(function() {
- // get my_media position
- my_media.getCurrentPosition(
- // success callback
- function(position) {
- if (position > -1) {
- setAudioPosition((position) + " sec");
- }
- },
- // error callback
- function(e) {
- console.log("Error getting pos=" + e);
- setAudioPosition("Error: " + e);
- }
- );
- }, 1000);
- }
- }
-
- // Pause audio
- //
- function pauseAudio() {
- if (my_media) {
- my_media.pause();
- }
- }
-
- // Stop audio
- //
- function stopAudio() {
- if (my_media) {
- my_media.stop();
- }
- clearInterval(mediaTimer);
- mediaTimer = null;
- }
-
- // onSuccess Callback
- //
- function onSuccess() {
- console.log("playAudio():Audio Success");
- }
-
- // onError Callback
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
-
- // Set audio position
- //
- 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');">Play Audio</a>
- <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
- <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
- <p id="audio_position"></p>
- </body>
- </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/media.getDuration.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.getDuration.md b/docs/en/edge/cordova/media/media.getDuration.md
deleted file mode 100644
index 50832db..0000000
--- a/docs/en/edge/cordova/media/media.getDuration.md
+++ /dev/null
@@ -1,162 +0,0 @@
----
-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
-
-Returns the duration of an audio file.
-
- media.getDuration();
-
-## Description
-
-The `media.getDuration` method executes synchronously, returning the
-duration of the audio file in seconds, if known. If the duration is
-unknown, it returns a value of -1.
-
-## Supported Platforms
-
-- Android
-- BlackBerry 10
-- iOS
-- Windows Phone 7 and 8
-- Tizen
-- Windows 8
-
-## Quick Example
-
- // Audio player
- //
- var my_media = new Media(src, onSuccess, onError);
-
- // Get duration
- 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);
-
-## Full Example
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <title>Media Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for device API libraries to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // device APIs are available
- //
- function onDeviceReady() {
- playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
- }
-
- // Audio player
- //
- var my_media = null;
- var mediaTimer = null;
-
- // Play audio
- //
- function playAudio(src) {
- // Create Media object from src
- my_media = new Media(src, onSuccess, onError);
-
- // Play audio
- my_media.play();
-
- // Update my_media position every second
- if (mediaTimer == null) {
- mediaTimer = setInterval(function() {
- // get my_media position
- my_media.getCurrentPosition(
- // success callback
- function(position) {
- if (position > -1) {
- setAudioPosition((position) + " sec");
- }
- },
- // error callback
- function(e) {
- console.log("Error getting pos=" + e);
- setAudioPosition("Error: " + e);
- }
- );
- }, 1000);
- }
- }
-
- // Pause audio
- //
- function pauseAudio() {
- if (my_media) {
- my_media.pause();
- }
- }
-
- // Stop audio
- //
- function stopAudio() {
- if (my_media) {
- my_media.stop();
- }
- clearInterval(mediaTimer);
- mediaTimer = null;
- }
-
- // onSuccess Callback
- //
- function onSuccess() {
- console.log("playAudio():Audio Success");
- }
-
- // onError Callback
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
-
- // Set audio position
- //
- 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');">Play Audio</a>
- <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
- <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
- <p id="audio_position"></p>
- </body>
- </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/media.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.md b/docs/en/edge/cordova/media/media.md
deleted file mode 100644
index 01f2239..0000000
--- a/docs/en/edge/cordova/media/media.md
+++ /dev/null
@@ -1,161 +0,0 @@
----
-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
-
-> The `Media` object provides the ability to record and play back audio files on a device.
-
- var media = new Media(src, mediaSuccess, [mediaError], [mediaStatus]);
-
-__NOTE__: The current implementation does not adhere to a W3C
-specification for media capture, and is provided for convenience only.
-A future implementation will adhere to the latest W3C specification
-and may deprecate the current APIs.
-
-## Parameters
-
-- __src__: A URI containing the audio content. _(DOMString)_
-
-- __mediaSuccess__: (Optional) The callback that executes after a `Media` object has completed the current play, record, or stop action. _(Function)_
-
-- __mediaError__: (Optional) The callback that executes if an error occurs. _(Function)_
-
-- __mediaStatus__: (Optional) The callback that executes to indicate status changes. _(Function)_
-
-## Constants
-
-The following constants are reported as the only parameter to the
-`mediaStatus` callback:
-
-- `Media.MEDIA_NONE` = 0;
-- `Media.MEDIA_STARTING` = 1;
-- `Media.MEDIA_RUNNING` = 2;
-- `Media.MEDIA_PAUSED` = 3;
-- `Media.MEDIA_STOPPED` = 4;
-
-## Methods
-
-- `media.getCurrentPosition`: Returns the current position within an audio file.
-
-- `media.getDuration`: Returns the duration of an audio file.
-
-- `media.play`: Start or resume playing an audio file.
-
-- `media.pause`: Pause playback of an audio file.
-
-- `media.release`: Releases the underlying operating system's audio resources.
-
-- `media.seekTo`: Moves the position within the audio file.
-
-- `media.setVolume`: Set the volume for audio playback.
-
-- `media.startRecord`: Start recording an audio file.
-
-- `media.stopRecord`: Stop recording an audio file.
-
-- `media.stop`: Stop playing an audio file.
-
-## Additional ReadOnly Parameters
-
-- __position__: The position within the audio playback, in seconds.
- - Not automatically updated during play; call `getCurrentPosition` to update.
-
-- __duration__: The duration of the media, in seconds.
-
-## Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- iOS
-- Windows Phone 7.5
-- Tizen
-- Windows 8
-
-## Accessing the Feature
-
-As of version 3.0, Cordova implements device-level APIs as _plugins_.
-Use the CLI's `plugin` command, described in The Command-Line
-Interface, to add or remove this feature for a project:
-
- $ cordova plugin add org.apache.cordova.media
- $ cordova plugin ls
- [ 'org.apache.cordova.media' ]
- $ cordova plugin rm org.apache.cordova.media
-
-These commands apply to all targeted platforms, but modify the
-platform-specific configuration settings described below:
-
-* Amazon Fire OS
-
- (in app/res/xml/config.xml)
- <feature name="Media">
- <param name="android-package" value="org.apache.cordova.media.AudioHandler" />
- </feature>
-
- (in 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" />
-
-* Android
-
- (in app/res/xml/config.xml)
- <feature name="Media">
- <param name="android-package" value="org.apache.cordova.media.AudioHandler" />
- </feature>
-
- (in 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" />
-
-* BlackBerry 10
-
- (in www/config.xml)
- <feature name="Media" value="Media" />
-
-* iOS (in the named application directory's `config.xml`)
-
- <feature name="Media">
- <param name="ios-package" value="CDVSound" />
- </feature>
-
-* Windows Phone (in `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>
-
- Reference: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx)
-
-Some platforms may support this feature without requiring any special
-configuration. See Platform Support for an overview.
-
-## Windows Phone Quirks
-
-- Only one media file can be played back at a time.
-
-- There are strict restrictions on how your application interacts with other media. See the [Microsoft documentation for details][url].
-
-[url]: 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/97ae96ee/docs/en/edge/cordova/media/media.pause.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.pause.md b/docs/en/edge/cordova/media/media.pause.md
deleted file mode 100644
index aa1c7fe..0000000
--- a/docs/en/edge/cordova/media/media.pause.md
+++ /dev/null
@@ -1,162 +0,0 @@
----
-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
-
-Pauses playing an audio file.
-
- media.pause();
-
-## Description
-
-The `media.pause` method executes synchronously, and pauses playing an audio file.
-
-## Supported Platforms
-
-- Android
-- BlackBerry 10
-- iOS
-- Windows Phone 7 and 8
-- Tizen
-- Windows 8
-
-## Quick Example
-
- // Play audio
- //
- function playAudio(url) {
- // Play the audio file at url
- var my_media = new Media(url,
- // success callback
- function () { console.log("playAudio():Audio Success"); },
- // error callback
- function (err) { console.log("playAudio():Audio Error: " + err); }
- );
-
- // Play audio
- my_media.play();
-
- // Pause after 10 seconds
- setTimeout(function () {
- media.pause();
- }, 10000);
- }
-
-## Full Example
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <title>Media Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for device API libraries to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // device APIs are available
- //
- function onDeviceReady() {
- playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
- }
-
- // Audio player
- //
- var my_media = null;
- var mediaTimer = null;
-
- // Play audio
- //
- function playAudio(src) {
- // Create Media object from src
- my_media = new Media(src, onSuccess, onError);
-
- // Play audio
- my_media.play();
-
- // Update my_media position every second
- if (mediaTimer == null) {
- mediaTimer = setInterval(function() {
- // get my_media position
- my_media.getCurrentPosition(
- // success callback
- function(position) {
- if (position > -1) {
- setAudioPosition((position) + " sec");
- }
- },
- // error callback
- function(e) {
- console.log("Error getting pos=" + e);
- setAudioPosition("Error: " + e);
- }
- );
- }, 1000);
- }
- }
-
- // Pause audio
- //
- function pauseAudio() {
- if (my_media) {
- my_media.pause();
- }
- }
-
- // Stop audio
- //
- function stopAudio() {
- if (my_media) {
- my_media.stop();
- }
- clearInterval(mediaTimer);
- mediaTimer = null;
- }
-
- // onSuccess Callback
- //
- function onSuccess() {
- console.log("playAudio():Audio Success");
- }
-
- // onError Callback
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
-
- // Set audio position
- //
- 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');">Play Audio</a>
- <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
- <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
- <p id="audio_position"></p>
- </body>
- </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/media.play.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.play.md b/docs/en/edge/cordova/media/media.play.md
deleted file mode 100644
index 4815263..0000000
--- a/docs/en/edge/cordova/media/media.play.md
+++ /dev/null
@@ -1,185 +0,0 @@
----
-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
-
-Starts or resumes playing an audio file.
-
- media.play();
-
-## Description
-
-The `media.play` method executes synchronously, and starts or resumes
-playing an audio file.
-
-## Supported Platforms
-
-- Android
-- BlackBerry 10
-- iOS
-- Windows Phone 7 and 8
-- Tizen
-- Windows 8
-
-## Quick Example
-
- // Play audio
- //
- function playAudio(url) {
- // Play the audio file at url
- var my_media = new Media(url,
- // success callback
- function () {
- console.log("playAudio():Audio Success");
- },
- // error callback
- function (err) {
- console.log("playAudio():Audio Error: " + err);
- }
- );
- // Play audio
- my_media.play();
- }
-
-## Full Example
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <title>Media Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for device API libraries to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // device APIs are available
- //
- function onDeviceReady() {
- playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
- }
-
- // Audio player
- //
- var my_media = null;
- var mediaTimer = null;
-
- // Play audio
- //
- function playAudio(src) {
- if (my_media == null) {
- // Create Media object from src
- my_media = new Media(src, onSuccess, onError);
- } // else play current audio
- // Play audio
- my_media.play();
-
- // Update my_media position every second
- if (mediaTimer == null) {
- mediaTimer = setInterval(function() {
- // get my_media position
- my_media.getCurrentPosition(
- // success callback
- function(position) {
- if (position > -1) {
- setAudioPosition((position) + " sec");
- }
- },
- // error callback
- function(e) {
- console.log("Error getting pos=" + e);
- setAudioPosition("Error: " + e);
- }
- );
- }, 1000);
- }
- }
-
- // Pause audio
- //
- function pauseAudio() {
- if (my_media) {
- my_media.pause();
- }
- }
-
- // Stop audio
- //
- function stopAudio() {
- if (my_media) {
- my_media.stop();
- }
- clearInterval(mediaTimer);
- mediaTimer = null;
- }
-
- // onSuccess Callback
- //
- function onSuccess() {
- console.log("playAudio():Audio Success");
- }
-
- // onError Callback
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
-
- // Set audio position
- //
- 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');">Play Audio</a>
- <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
- <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
- <p id="audio_position"></p>
- </body>
- </html>
-
-## iOS Quirks
-
-- __numberOfLoops__: Pass this option to the `play` method to specify
- the number of times you want the media file to play, e.g.:
-
- var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3")
- myMedia.play({ numberOfLoops: 2 })
-
-- __playAudioWhenScreenIsLocked__: Pass in this option to the `play`
- method to specify whether you want to allow playback when the screen
- is locked. If set to `true` (the default value), the state of the
- hardware mute button is ignored, e.g.:
-
- var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3")
- myMedia.play({ playAudioWhenScreenIsLocked : false })
-
-- __order of file search__: When only a file name or simple path is
- provided, iOS searches in the `www` directory for the file, then in
- the application's `documents/tmp` directory:
-
- var myMedia = new Media("audio/beer.mp3")
- myMedia.play() // first looks for file in www/audio/beer.mp3 then in <application>/documents/tmp/audio/beer.mp3
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/media.release.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.release.md b/docs/en/edge/cordova/media/media.release.md
deleted file mode 100644
index e06d0a1..0000000
--- a/docs/en/edge/cordova/media/media.release.md
+++ /dev/null
@@ -1,154 +0,0 @@
----
-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
-
-Releases the underlying operating system's audio resources.
-
- media.release();
-
-## Description
-
-The `media.release` method executes synchronously, releasing the
-underlying operating system's audio resources. This is particularly
-important for Android, since there are a finite amount of OpenCore
-instances for media playback. Applications should call the `release`
-function for any `Media` resource that is no longer needed.
-
-## Supported Platforms
-
-- Android
-- BlackBerry 10
-- iOS
-- Windows Phone 7 and 8
-- Tizen
-- Windows 8
-
-## Quick Example
-
- // Audio player
- //
- var my_media = new Media(src, onSuccess, onError);
-
- my_media.play();
- my_media.stop();
- my_media.release();
-
-## Full Example
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <title>Media Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for device API libraries to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // device APIs are available
- //
- function onDeviceReady() {
- playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
- }
-
- // Audio player
- //
- var my_media = null;
- var mediaTimer = null;
-
- // Play audio
- //
- function playAudio(src) {
- // Create Media object from src
- my_media = new Media(src, onSuccess, onError);
-
- // Play audio
- my_media.play();
-
- // Update my_media position every second
- if (mediaTimer == null) {
- mediaTimer = setInterval(function() {
- // get my_media position
- my_media.getCurrentPosition(
- // success callback
- function(position) {
- if (position > -1) {
- setAudioPosition((position) + " sec");
- }
- },
- // error callback
- function(e) {
- console.log("Error getting pos=" + e);
- setAudioPosition("Error: " + e);
- }
- );
- }, 1000);
- }
- }
-
- // Pause audio
- //
- function pauseAudio() {
- if (my_media) {
- my_media.pause();
- }
- }
-
- // Stop audio
- //
- function stopAudio() {
- if (my_media) {
- my_media.stop();
- }
- clearInterval(mediaTimer);
- mediaTimer = null;
- }
-
- // onSuccess Callback
- //
- function onSuccess() {
- console.log("playAudio():Audio Success");
- }
-
- // onError Callback
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
-
- // Set audio position
- //
- 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');">Play Audio</a>
- <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
- <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
- <p id="audio_position"></p>
- </body>
- </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/media.seekTo.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.seekTo.md b/docs/en/edge/cordova/media/media.seekTo.md
deleted file mode 100644
index 23fc574..0000000
--- a/docs/en/edge/cordova/media/media.seekTo.md
+++ /dev/null
@@ -1,154 +0,0 @@
----
-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
-
-Sets the current position within an audio file.
-
- media.seekTo(milliseconds);
-
-## Parameters
-
-- __milliseconds__: The position to set the playback position within the audio, in milliseconds.
-
-## Description
-
-The `media.seekTo` executes asynchronously, updating the current
-playback position within an audio file referenced by a `Media`
-object. Also updates the `Media` object's `position` parameter.
-
-## Supported Platforms
-
-- Android
-- BlackBerry 10 (OS 6.0 and higher)
-- iOS
-- Windows Phone 7 and 8
-- Tizen
-- Windows 8
-
-## Quick Example
-
- // Audio player
- //
- var my_media = new Media(src, onSuccess, onError);
- my_media.play();
- // SeekTo to 10 seconds after 5 seconds
- setTimeout(function() {
- my_media.seekTo(10000);
- }, 5000);
-
-## Full Example
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <title>Media Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for device API libraries to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // device APIs are available
- //
- function onDeviceReady() {
- playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
- }
-
- // Audio player
- //
- var my_media = null;
- var mediaTimer = null;
-
- // Play audio
- //
- function playAudio(src) {
- // Create Media object from src
- my_media = new Media(src, onSuccess, onError);
-
- // Play audio
- my_media.play();
-
- // Update media position every second
- mediaTimer = setInterval(function() {
- // get media position
- my_media.getCurrentPosition(
- // success callback
- function(position) {
- if (position > -1) {
- setAudioPosition(position + " sec");
- }
- },
- // error callback
- function(e) {
- console.log("Error getting pos=" + e);
- }
- );
- }, 1000);
-
- // SeekTo to 10 seconds after 5 seconds
- setTimeout(function() {
- my_media.seekTo(10000);
- }, 5000);
- }
-
- // Stop audio
- //
- function stopAudio() {
- if (my_media) {
- my_media.stop();
- }
- clearInterval(mediaTimer);
- mediaTimer = null;
- }
-
- // onSuccess Callback
- //
- function onSuccess() {
- console.log("playAudio():Audio Success");
- }
-
- // onError Callback
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
-
- // Set audio position
- //
- 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');">Play Audio</a>
- <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
- <p id="audio_position"></p>
- </body>
- </html>
-
-## BlackBerry 10 Quirks
-
-- Not supported on BlackBerry OS 5 devices.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/media.setVolume.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.setVolume.md b/docs/en/edge/cordova/media/media.setVolume.md
deleted file mode 100644
index 403858e..0000000
--- a/docs/en/edge/cordova/media/media.setVolume.md
+++ /dev/null
@@ -1,171 +0,0 @@
----
-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.setVolume
-
-Set the volume for an audio file.
-
- media.setVolume(volume);
-
-## Parameters
-
-- __volume__: The volume to set for playback. The value must be within the range of 0.0 to 1.0.
-
-## Description
-
-Function `media.setVolume` is an asynchronous function that sets the volume during audio playback.
-
-## Supported Platforms
-
-- Android
-- iOS
-
-## Quick Example
-
- // Play audio
- //
- function playAudio(url) {
- // Play the audio file at url
- var my_media = new Media(url,
- // success callback
- function() {
- console.log("playAudio():Audio Success");
- },
- // error callback
- function(err) {
- console.log("playAudio():Audio Error: "+err);
- });
-
- // Play audio
- my_media.play();
-
- // Mute volume after 2 seconds
- setTimeout(function() {
- my_media.setVolume('0.0');
- }, 2000);
-
- // Set volume to 1.0 after 5 seconds
- setTimeout(function() {
- my_media.setVolume('1.0');
- }, 5000);
- }
-
-## Full Example
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <title>Media Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for Cordova to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // Cordova is ready
- //
- function onDeviceReady() {
- playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
- }
-
- // Audio player
- //
- var my_media = null;
- var mediaTimer = null;
-
- // Play audio
- //
- function playAudio(src) {
- // Create Media object from src
- my_media = new Media(src, onSuccess, onError);
-
- // Play audio
- my_media.play();
-
- // Update my_media position every second
- if (mediaTimer == null) {
- mediaTimer = setInterval(function() {
- // get my_media position
- my_media.getCurrentPosition(
- // success callback
- function(position) {
- if (position > -1) {
- setAudioPosition((position) + " sec");
- }
- },
- // error callback
- function(e) {
- console.log("Error getting pos=" + e);
- setAudioPosition("Error: " + e);
- }
- );
- }, 1000);
- }
- }
-
- // Set audio volume
- //
- function setVolume(volume) {
- if (my_media) {
- my_media.setVolume(volume);
- }
- }
-
- // Stop audio
- //
- function stopAudio() {
- if (my_media) {
- my_media.stop();
- }
- clearInterval(mediaTimer);
- mediaTimer = null;
- }
-
- // onSuccess Callback
- //
- function onSuccess() {
- console.log("playAudio():Audio Success");
- }
-
- // onError Callback
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
-
- // Set audio position
- //
- 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');">Play Audio</a>
- <a href="#" class="btn large" onclick="setVolume('0.0');">Mute Audio</a>
- <a href="#" class="btn large" onclick="setVolume('1.0');">Unmute Audio</a>
- <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
- <p id="audio_position"></p>
- </body>
- </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/media.startRecord.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.startRecord.md b/docs/en/edge/cordova/media/media.startRecord.md
deleted file mode 100644
index 3f998ef..0000000
--- a/docs/en/edge/cordova/media/media.startRecord.md
+++ /dev/null
@@ -1,143 +0,0 @@
----
-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
-
-Starts recording an audio file.
-
- media.startRecord();
-
-## Description
-
-The `media.startRecord` method executes synchronously, starts a
-recording for an audio file.
-
-## Supported Platforms
-
-- Android
-- iOS
-- Windows Phone 7 and 8
-- Windows 8
-
-## Quick Example
-
- // Record audio
- //
- function recordAudio() {
- var src = "myrecording.mp3";
- var mediaRec = new Media(src,
- // success callback
- function() {
- console.log("recordAudio():Audio Success");
- },
-
- // error callback
- function(err) {
- console.log("recordAudio():Audio Error: "+ err.code);
- });
-
- // Record audio
- mediaRec.startRecord();
- }
-
-## Full Example
-
- <!DOCTYPE html>
- <html>
- <head>
- <title>Device Properties Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for device API libraries to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // Record audio
- //
- function recordAudio() {
- var src = "myrecording.amr";
- var mediaRec = new Media(src, onSuccess, onError);
-
- // Record audio
- mediaRec.startRecord();
-
- // Stop recording after 10 sec
- var recTime = 0;
- var recInterval = setInterval(function() {
- recTime = recTime + 1;
- setAudioPosition(recTime + " sec");
- if (recTime >= 10) {
- clearInterval(recInterval);
- mediaRec.stopRecord();
- }
- }, 1000);
- }
-
- // device APIs are available
- //
- function onDeviceReady() {
- recordAudio();
- }
-
- // onSuccess Callback
- //
- function onSuccess() {
- console.log("recordAudio():Audio Success");
- }
-
- // onError Callback
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
-
- // Set audio position
- //
- function setAudioPosition(position) {
- document.getElementById('audio_position').innerHTML = position;
- }
-
- </script>
- </head>
- <body>
- <p id="media">Recording audio...</p>
- <p id="audio_position"></p>
- </body>
- </html>
-
-## Android Quirks
-
-- Android devices record audio in Adaptive Multi-Rate format. The specified file should end with a _.amr_ extension.
-
-## iOS Quirks
-
-- iOS only records to files of type _.wav_ and returns an error if the file name extension is not correct.
-
-- If a full path is not provided, the recording is placed in the application's `documents/tmp` directory. This can be accessed via the `File` API using `LocalFileSystem.TEMPORARY`. Any subdirectory specified at record time must already exist.
-
-- Files can be recorded and played back using the documents URI:
-
- var myMedia = new Media("documents://beer.mp3")
-
-## Tizen Quirks
-
-- Not supported on Tizen devices.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/media.stop.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.stop.md b/docs/en/edge/cordova/media/media.stop.md
deleted file mode 100644
index bfcab73..0000000
--- a/docs/en/edge/cordova/media/media.stop.md
+++ /dev/null
@@ -1,167 +0,0 @@
----
-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
-
-Stops playing an audio file.
-
- media.stop();
-
-## Description
-
-The `media.stop` method executes synchronously to stop playing an
-audio file.
-
-## Supported Platforms
-
-- Android
-- BlackBerry 10
-- iOS
-- Windows Phone 7 and 8
-- Tizen
-- Windows 8
-
-## Quick Example
-
- // Play audio
- //
- function playAudio(url) {
- // Play the audio file at url
- var my_media = new Media(url,
- // success callback
- function() {
- console.log("playAudio():Audio Success");
- },
- // error callback
- function(err) {
- console.log("playAudio():Audio Error: "+err);
- }
- );
-
- // Play audio
- my_media.play();
-
- // Pause after 10 seconds
- setTimeout(function() {
- my_media.stop();
- }, 10000);
- }
-
-## Full Example
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <title>Media Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for device API libraries to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // device APIs are available
- //
- function onDeviceReady() {
- playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
- }
-
- // Audio player
- //
- var my_media = null;
- var mediaTimer = null;
-
- // Play audio
- //
- function playAudio(src) {
- // Create Media object from src
- my_media = new Media(src, onSuccess, onError);
-
- // Play audio
- my_media.play();
-
- // Update my_media position every second
- if (mediaTimer == null) {
- mediaTimer = setInterval(function() {
- // get my_media position
- my_media.getCurrentPosition(
- // success callback
- function(position) {
- if (position > -1) {
- setAudioPosition((position) + " sec");
- }
- },
- // error callback
- function(e) {
- console.log("Error getting pos=" + e);
- setAudioPosition("Error: " + e);
- }
- );
- }, 1000);
- }
- }
-
- // Pause audio
- //
- function pauseAudio() {
- if (my_media) {
- my_media.pause();
- }
- }
-
- // Stop audio
- //
- function stopAudio() {
- if (my_media) {
- my_media.stop();
- }
- clearInterval(mediaTimer);
- mediaTimer = null;
- }
-
- // onSuccess Callback
- //
- function onSuccess() {
- console.log("playAudio():Audio Success");
- }
-
- // onError Callback
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
-
- // Set audio position
- //
- 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');">Play Audio</a>
- <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
- <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
- <p id="audio_position"></p>
- </body>
- </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/media/media.stopRecord.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/media/media.stopRecord.md b/docs/en/edge/cordova/media/media.stopRecord.md
deleted file mode 100644
index 472ef2a..0000000
--- a/docs/en/edge/cordova/media/media.stopRecord.md
+++ /dev/null
@@ -1,135 +0,0 @@
----
-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
-
-Stops recording an audio file.
-
- media.stopRecord();
-
-## Description
-
-The `media.stopRecord` method executes synchronously, stopping the
-recording of an audio file.
-
-## Supported Platforms
-
-- Android
-- iOS
-- Windows Phone 7 and 8
-- Windows 8
-
-## Quick Example
-
- // Record audio
- //
- function recordAudio() {
- var src = "myrecording.mp3";
- var mediaRec = new Media(src,
- // success callback
- function() {
- console.log("recordAudio():Audio Success");
- },
-
- // error callback
- function(err) {
- console.log("recordAudio():Audio Error: "+ err.code);
- }
- );
-
- // Record audio
- mediaRec.startRecord();
-
- // Stop recording after 10 seconds
- setTimeout(function() {
- mediaRec.stopRecord();
- }, 10000);
- }
-
-## Full Example
-
- <!DOCTYPE html>
- <html>
- <head>
- <title>Device Properties Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for device API libraries to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // Record audio
- //
- function recordAudio() {
- var src = "myrecording.mp3";
- var mediaRec = new Media(src, onSuccess, onError);
-
- // Record audio
- mediaRec.startRecord();
-
- // Stop recording after 10 sec
- var recTime = 0;
- var recInterval = setInterval(function() {
- recTime = recTime + 1;
- setAudioPosition(recTime + " sec");
- if (recTime >= 10) {
- clearInterval(recInterval);
- mediaRec.stopRecord();
- }
- }, 1000);
- }
-
- // device APIs are available
- //
- function onDeviceReady() {
- recordAudio();
- }
-
- // onSuccess Callback
- //
- function onSuccess() {
- console.log("recordAudio():Audio Success");
- }
-
- // onError Callback
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
-
- // Set audio position
- //
- function setAudioPosition(position) {
- document.getElementById('audio_position').innerHTML = position;
- }
-
- </script>
- </head>
- <body>
- <p id="media">Recording audio...</p>
- <p id="audio_position"></p>
- </body>
- </html>
-
-## Tizen Quirks
-
-- Not supported on Tizen devices.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/97ae96ee/docs/en/edge/cordova/notification/notification.alert.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/notification/notification.alert.md b/docs/en/edge/cordova/notification/notification.alert.md
deleted file mode 100644
index fba120d..0000000
--- a/docs/en/edge/cordova/notification/notification.alert.md
+++ /dev/null
@@ -1,115 +0,0 @@
----
-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
-
-Shows a custom alert or dialog box.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-- __message__: Dialog message. _(String)_
-
-- __alertCallback__: Callback to invoke when alert dialog is dismissed. _(Function)_
-
-- __title__: Dialog title. _(String)_ (Optional, defaults to `Alert`)
-
-- __buttonName__: Button name. _(String)_ (Optional, defaults to `OK`)
-
-## Description
-
-Most Cordova implementations use a native dialog box for this feature,
-but some platforms use the browser's `alert` function, which is
-typically less customizable.
-
-## Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- iOS
-- Tizen
-- Windows Phone 7 and 8
-- Windows 8
-
-## Quick Example
-
- // Amazon Fire OS / Android / BlackBerry 10 (OS 5.0 and higher) / iOS / Tizen
- //
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-## Full Example
-
- <!DOCTYPE html>
- <html>
- <head>
- <title>Notification Example</title>
-
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- // Wait for device API libraries to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
-
- // device APIs are available
- //
- function onDeviceReady() {
- // Empty
- }
-
- // alert dialog dismissed
- function alertDismissed() {
- // do something
- }
-
- // Show a custom alertDismissed
- //
- function showAlert() {
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
- }
-
- </script>
- </head>
- <body>
- <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>
- </body>
- </html>
-
-## Windows Phone 7 and 8 Quirks
-
-- There is no built-in browser alert, but you can bind one as follows to call `alert()` in the global scope:
-
- window.alert = navigator.notification.alert;
-
-- Both `alert` and `confirm` are non-blocking calls, results of which are only available asynchronously.
-