You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/06/21 23:53:10 UTC
[3/4] git commit: added docs + test
added docs + test
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/db962e6d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/db962e6d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/db962e6d
Branch: refs/heads/master
Commit: db962e6d3faa0e474535343a020a38a2dfecbbcc
Parents: a2b572f
Author: Steven Gill <st...@gmail.com>
Authored: Fri Jun 21 14:52:15 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Fri Jun 21 14:52:15 2013 -0700
----------------------------------------------------------------------
docs/.DS_Store | Bin 0 -> 6148 bytes
docs/MediaError/mediaError.md | 45 +
docs/Parameters/mediaError.md | 33 +
docs/media.getCurrentPosition.md | 176 ++
docs/media.getDuration.md | 167 ++
docs/media.md | 145 ++
docs/media.pause.md | 167 ++
docs/media.play.md | 200 ++
docs/media.release.md | 159 ++
docs/media.seekTo.md | 161 ++
docs/media.setVolume.md | 178 ++
docs/media.startRecord.md | 155 ++
docs/media.stop.md | 172 ++
docs/media.stopRecord.md | 142 ++
test/autotest/html/HtmlReporter.js | 101 +
test/autotest/html/HtmlReporterHelpers.js | 60 +
test/autotest/html/ReporterView.js | 164 ++
test/autotest/html/SpecView.js | 79 +
test/autotest/html/SuiteView.js | 22 +
test/autotest/html/TrivialReporter.js | 192 ++
test/autotest/index.html | 60 +
test/autotest/jasmine.css | 81 +
test/autotest/jasmine.js | 2530 ++++++++++++++++++++++++
test/autotest/pages/.DS_Store | Bin 0 -> 6148 bytes
test/autotest/pages/media.html | 71 +
test/autotest/test-runner.js | 62 +
test/autotest/tests/.DS_Store | Bin 0 -> 6148 bytes
test/autotest/tests/media.tests.js | 174 ++
test/cordova-incl.js | 85 +
test/index.html | 64 +
test/main.js | 162 ++
test/master.css | 164 ++
32 files changed, 5971 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/db962e6d/docs/.DS_Store
----------------------------------------------------------------------
diff --git a/docs/.DS_Store b/docs/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/docs/.DS_Store differ
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/db962e6d/docs/MediaError/mediaError.md
----------------------------------------------------------------------
diff --git a/docs/MediaError/mediaError.md b/docs/MediaError/mediaError.md
new file mode 100644
index 0000000..5652a27
--- /dev/null
+++ b/docs/MediaError/mediaError.md
@@ -0,0 +1,45 @@
+---
+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.
+---
+
+MediaError
+==========
+
+A `MediaError` object is returned to the `mediaError` callback
+function when an error occurs.
+
+Properties
+----------
+
+- __code__: One of the predefined error codes listed below.
+- __message__: An error message describing the details of the error.
+
+Constants
+---------
+
+- `MediaError.MEDIA_ERR_ABORTED`
+- `MediaError.MEDIA_ERR_NETWORK`
+- `MediaError.MEDIA_ERR_DECODE`
+- `MediaError.MEDIA_ERR_NONE_SUPPORTED`
+
+Description
+-----------
+
+The `MediaError` object is passed to a `mediaError` callback function
+when an error occurs.
+
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/db962e6d/docs/Parameters/mediaError.md
----------------------------------------------------------------------
diff --git a/docs/Parameters/mediaError.md b/docs/Parameters/mediaError.md
new file mode 100644
index 0000000..08b4400
--- /dev/null
+++ b/docs/Parameters/mediaError.md
@@ -0,0 +1,33 @@
+---
+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.
+---
+
+mediaError
+==========
+
+A user-specified callback function that executes when there is an
+error in media functions.
+
+ function(error) {
+ // Handle the error
+ }
+
+Parameters
+----------
+
+- __error__: The error returned by the device. _(MediaError)_
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/db962e6d/docs/media.getCurrentPosition.md
----------------------------------------------------------------------
diff --git a/docs/media.getCurrentPosition.md b/docs/media.getCurrentPosition.md
new file mode 100644
index 0000000..171bec6
--- /dev/null
+++ b/docs/media.getCurrentPosition.md
@@ -0,0 +1,176 @@
+---
+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 WebWorks (OS 5.0 and higher)
+- 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-x.x.x.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-plugin-media/blob/db962e6d/docs/media.getDuration.md
----------------------------------------------------------------------
diff --git a/docs/media.getDuration.md b/docs/media.getDuration.md
new file mode 100644
index 0000000..f48f9a0
--- /dev/null
+++ b/docs/media.getDuration.md
@@ -0,0 +1,167 @@
+---
+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 WebWorks (OS 5.0 and higher)
+- 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-x.x.x.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-plugin-media/blob/db962e6d/docs/media.md
----------------------------------------------------------------------
diff --git a/docs/media.md b/docs/media.md
new file mode 100644
index 0000000..79d706b
--- /dev/null
+++ b/docs/media.md
@@ -0,0 +1,145 @@
+---
+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
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Windows Phone 7.5
+- Tizen
+- Windows 8
+
+Permissions
+-----------
+
+### 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
+
+#### config.xml
+
+ <plugin name="Media" value="CDVSound" />
+
+### webOS
+
+ No permissions are required.
+
+### 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>
+
+Reference: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx)
+
+### Tizen
+
+ No permissions are required.
+
+### 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-plugin-media/blob/db962e6d/docs/media.pause.md
----------------------------------------------------------------------
diff --git a/docs/media.pause.md b/docs/media.pause.md
new file mode 100644
index 0000000..aa72280
--- /dev/null
+++ b/docs/media.pause.md
@@ -0,0 +1,167 @@
+---
+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 WebWorks (OS 5.0 and higher)
+- 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-x.x.x.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-plugin-media/blob/db962e6d/docs/media.play.md
----------------------------------------------------------------------
diff --git a/docs/media.play.md b/docs/media.play.md
new file mode 100644
index 0000000..19899db
--- /dev/null
+++ b/docs/media.play.md
@@ -0,0 +1,200 @@
+---
+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 WebWorks (OS 5.0 and higher)
+- 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-x.x.x.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>
+
+BlackBerry WebWorks Quirks
+----------
+
+- BlackBerry devices support a limited number of simultaneous audio
+ channels. CDMA devices only support a single audio channel. Other
+ devices support up to two simultaneous channels. An attempt to play
+ more audio files than the supported amount results in previous
+ playback being stopped.
+
+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-plugin-media/blob/db962e6d/docs/media.release.md
----------------------------------------------------------------------
diff --git a/docs/media.release.md b/docs/media.release.md
new file mode 100644
index 0000000..5ce1c4a
--- /dev/null
+++ b/docs/media.release.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.
+---
+
+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 WebWorks (OS 5.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();
+ 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-x.x.x.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-plugin-media/blob/db962e6d/docs/media.seekTo.md
----------------------------------------------------------------------
diff --git a/docs/media.seekTo.md b/docs/media.seekTo.md
new file mode 100644
index 0000000..371705c
--- /dev/null
+++ b/docs/media.seekTo.md
@@ -0,0 +1,161 @@
+---
+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 WebWorks (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-x.x.x.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 WebWorks Quirks
+----------
+
+- Not supported on BlackBerry OS 5 devices.
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/db962e6d/docs/media.setVolume.md
----------------------------------------------------------------------
diff --git a/docs/media.setVolume.md b/docs/media.setVolume.md
new file mode 100644
index 0000000..48a934a
--- /dev/null
+++ b/docs/media.setVolume.md
@@ -0,0 +1,178 @@
+---
+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);
+
+Paramters
+---------
+
+- __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-x.x.x.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>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/db962e6d/docs/media.startRecord.md
----------------------------------------------------------------------
diff --git a/docs/media.startRecord.md b/docs/media.startRecord.md
new file mode 100644
index 0000000..b94cee9
--- /dev/null
+++ b/docs/media.startRecord.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.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
+- BlackBerry WebWorks (OS 5.0 and higher)
+- 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-x.x.x.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.
+
+BlackBerry WebWorks Quirks
+----------
+
+- BlackBerry devices record audio in Adaptive Multi-Rate format. The specified file must 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-plugin-media/blob/db962e6d/docs/media.stop.md
----------------------------------------------------------------------
diff --git a/docs/media.stop.md b/docs/media.stop.md
new file mode 100644
index 0000000..77318d6
--- /dev/null
+++ b/docs/media.stop.md
@@ -0,0 +1,172 @@
+---
+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 WebWorks (OS 5.0 and higher)
+- 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-x.x.x.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-plugin-media/blob/db962e6d/docs/media.stopRecord.md
----------------------------------------------------------------------
diff --git a/docs/media.stopRecord.md b/docs/media.stopRecord.md
new file mode 100644
index 0000000..03fc246
--- /dev/null
+++ b/docs/media.stopRecord.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.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
+- BlackBerry WebWorks (OS 5.0 and higher)
+- 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-x.x.x.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-plugin-media/blob/db962e6d/test/autotest/html/HtmlReporter.js
----------------------------------------------------------------------
diff --git a/test/autotest/html/HtmlReporter.js b/test/autotest/html/HtmlReporter.js
new file mode 100644
index 0000000..7d9d924
--- /dev/null
+++ b/test/autotest/html/HtmlReporter.js
@@ -0,0 +1,101 @@
+jasmine.HtmlReporter = function(_doc) {
+ var self = this;
+ var doc = _doc || window.document;
+
+ var reporterView;
+
+ var dom = {};
+
+ // Jasmine Reporter Public Interface
+ self.logRunningSpecs = false;
+
+ self.reportRunnerStarting = function(runner) {
+ var specs = runner.specs() || [];
+
+ if (specs.length == 0) {
+ return;
+ }
+
+ createReporterDom(runner.env.versionString());
+ doc.body.appendChild(dom.reporter);
+
+ reporterView = new jasmine.HtmlReporter.ReporterView(dom);
+ reporterView.addSpecs(specs, self.specFilter);
+ };
+
+ self.reportRunnerResults = function(runner) {
+ reporterView && reporterView.complete();
+ };
+
+ self.reportSuiteResults = function(suite) {
+ reporterView.suiteComplete(suite);
+ };
+
+ self.reportSpecStarting = function(spec) {
+ if (self.logRunningSpecs) {
+ self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
+ }
+ };
+
+ self.reportSpecResults = function(spec) {
+ reporterView.specComplete(spec);
+ };
+
+ self.log = function() {
+ var console = jasmine.getGlobal().console;
+ if (console && console.log) {
+ if (console.log.apply) {
+ console.log.apply(console, arguments);
+ } else {
+ console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
+ }
+ }
+ };
+
+ self.specFilter = function(spec) {
+ if (!focusedSpecName()) {
+ return true;
+ }
+
+ return spec.getFullName().indexOf(focusedSpecName()) === 0;
+ };
+
+ return self;
+
+ function focusedSpecName() {
+ var specName;
+
+ (function memoizeFocusedSpec() {
+ if (specName) {
+ return;
+ }
+
+ var paramMap = [];
+ var params = doc.location.search.substring(1).split('&');
+
+ for (var i = 0; i < params.length; i++) {
+ var p = params[i].split('=');
+ paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
+ }
+
+ specName = paramMap.spec;
+ })();
+
+ return specName;
+ }
+
+ function createReporterDom(version) {
+ dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
+ dom.banner = self.createDom('div', { className: 'banner' },
+ self.createDom('span', { className: 'title' }, "Jasmine "),
+ self.createDom('span', { className: 'version' }, version)),
+
+ dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
+ dom.alert = self.createDom('div', {className: 'alert'}),
+ dom.results = self.createDom('div', {className: 'results'},
+ dom.summary = self.createDom('div', { className: 'summary' }),
+ dom.details = self.createDom('div', { id: 'details' }))
+ );
+ }
+};
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/db962e6d/test/autotest/html/HtmlReporterHelpers.js
----------------------------------------------------------------------
diff --git a/test/autotest/html/HtmlReporterHelpers.js b/test/autotest/html/HtmlReporterHelpers.js
new file mode 100644
index 0000000..745e1e0
--- /dev/null
+++ b/test/autotest/html/HtmlReporterHelpers.js
@@ -0,0 +1,60 @@
+jasmine.HtmlReporterHelpers = {};
+
+jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
+ var el = document.createElement(type);
+
+ for (var i = 2; i < arguments.length; i++) {
+ var child = arguments[i];
+
+ if (typeof child === 'string') {
+ el.appendChild(document.createTextNode(child));
+ } else {
+ if (child) {
+ el.appendChild(child);
+ }
+ }
+ }
+
+ for (var attr in attrs) {
+ if (attr == "className") {
+ el[attr] = attrs[attr];
+ } else {
+ el.setAttribute(attr, attrs[attr]);
+ }
+ }
+
+ return el;
+};
+
+jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
+ var results = child.results();
+ var status = results.passed() ? 'passed' : 'failed';
+ if (results.skipped) {
+ status = 'skipped';
+ }
+
+ return status;
+};
+
+jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
+ var parentDiv = this.dom.summary;
+ var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
+ var parent = child[parentSuite];
+
+ if (parent) {
+ if (typeof this.views.suites[parent.id] == 'undefined') {
+ this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
+ }
+ parentDiv = this.views.suites[parent.id].element;
+ }
+
+ parentDiv.appendChild(childElement);
+};
+
+
+jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
+ for(var fn in jasmine.HtmlReporterHelpers) {
+ ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
+ }
+};
+
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/db962e6d/test/autotest/html/ReporterView.js
----------------------------------------------------------------------
diff --git a/test/autotest/html/ReporterView.js b/test/autotest/html/ReporterView.js
new file mode 100644
index 0000000..6a6d005
--- /dev/null
+++ b/test/autotest/html/ReporterView.js
@@ -0,0 +1,164 @@
+jasmine.HtmlReporter.ReporterView = function(dom) {
+ this.startedAt = new Date();
+ this.runningSpecCount = 0;
+ this.completeSpecCount = 0;
+ this.passedCount = 0;
+ this.failedCount = 0;
+ this.skippedCount = 0;
+
+ this.createResultsMenu = function() {
+ this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
+ this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
+ ' | ',
+ this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
+
+ this.summaryMenuItem.onclick = function() {
+ dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
+ };
+
+ this.detailsMenuItem.onclick = function() {
+ showDetails();
+ };
+ };
+
+ this.addSpecs = function(specs, specFilter) {
+ this.totalSpecCount = specs.length;
+
+ this.views = {
+ specs: {},
+ suites: {}
+ };
+
+ for (var i = 0; i < specs.length; i++) {
+ var spec = specs[i];
+ this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
+ if (specFilter(spec)) {
+ this.runningSpecCount++;
+ }
+ }
+ };
+
+ this.specComplete = function(spec) {
+ this.completeSpecCount++;
+
+ if (isUndefined(this.views.specs[spec.id])) {
+ this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
+ }
+
+ var specView = this.views.specs[spec.id];
+
+ switch (specView.status()) {
+ case 'passed':
+ this.passedCount++;
+ break;
+
+ case 'failed':
+ this.failedCount++;
+ break;
+
+ case 'skipped':
+ this.skippedCount++;
+ break;
+ }
+
+ specView.refresh();
+ this.refresh();
+ };
+
+ this.suiteComplete = function(suite) {
+ var suiteView = this.views.suites[suite.id];
+ if (isUndefined(suiteView)) {
+ return;
+ }
+ suiteView.refresh();
+ };
+
+ this.refresh = function() {
+
+ if (isUndefined(this.resultsMenu)) {
+ this.createResultsMenu();
+ }
+
+ // currently running UI
+ if (isUndefined(this.runningAlert)) {
+ this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"});
+ dom.alert.appendChild(this.runningAlert);
+ }
+ this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
+
+ // skipped specs UI
+ if (isUndefined(this.skippedAlert)) {
+ this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"});
+ }
+
+ this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
+
+ if (this.skippedCount === 1 && isDefined(dom.alert)) {
+ dom.alert.appendChild(this.skippedAlert);
+ }
+
+ // passing specs UI
+ if (isUndefined(this.passedAlert)) {
+ this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"});
+ }
+ this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
+
+ // failing specs UI
+ if (isUndefined(this.failedAlert)) {
+ this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
+ }
+ this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
+
+ if (this.failedCount === 1 && isDefined(dom.alert)) {
+ dom.alert.appendChild(this.failedAlert);
+ dom.alert.appendChild(this.resultsMenu);
+ }
+
+ // summary info
+ this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
+ this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
+ };
+
+ this.complete = function() {
+ dom.alert.removeChild(this.runningAlert);
+
+ this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
+
+ if (this.failedCount === 0) {
+ dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
+ } else {
+ showDetails();
+ }
+
+ dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
+ };
+
+ return this;
+
+ function showDetails() {
+ if (dom.reporter.className.search(/showDetails/) === -1) {
+ dom.reporter.className += " showDetails";
+ }
+ }
+
+ function isUndefined(obj) {
+ return typeof obj === 'undefined';
+ }
+
+ function isDefined(obj) {
+ return !isUndefined(obj);
+ }
+
+ function specPluralizedFor(count) {
+ var str = count + " spec";
+ if (count > 1) {
+ str += "s"
+ }
+ return str;
+ }
+
+};
+
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
+
+
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/db962e6d/test/autotest/html/SpecView.js
----------------------------------------------------------------------
diff --git a/test/autotest/html/SpecView.js b/test/autotest/html/SpecView.js
new file mode 100644
index 0000000..e8a3c23
--- /dev/null
+++ b/test/autotest/html/SpecView.js
@@ -0,0 +1,79 @@
+jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
+ this.spec = spec;
+ this.dom = dom;
+ this.views = views;
+
+ this.symbol = this.createDom('li', { className: 'pending' });
+ this.dom.symbolSummary.appendChild(this.symbol);
+
+ this.summary = this.createDom('div', { className: 'specSummary' },
+ this.createDom('a', {
+ className: 'description',
+ href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
+ title: this.spec.getFullName()
+ }, this.spec.description)
+ );
+
+ this.detail = this.createDom('div', { className: 'specDetail' },
+ this.createDom('a', {
+ className: 'description',
+ href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
+ title: this.spec.getFullName()
+ }, this.spec.getFullName())
+ );
+};
+
+jasmine.HtmlReporter.SpecView.prototype.status = function() {
+ return this.getSpecStatus(this.spec);
+};
+
+jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
+ this.symbol.className = this.status();
+
+ switch (this.status()) {
+ case 'skipped':
+ break;
+
+ case 'passed':
+ this.appendSummaryToSuiteDiv();
+ break;
+
+ case 'failed':
+ this.appendSummaryToSuiteDiv();
+ this.appendFailureDetail();
+ break;
+ }
+};
+
+jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
+ this.summary.className += ' ' + this.status();
+ this.appendToSummary(this.spec, this.summary);
+};
+
+jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
+ this.detail.className += ' ' + this.status();
+
+ var resultItems = this.spec.results().getItems();
+ var messagesDiv = this.createDom('div', { className: 'messages' });
+
+ for (var i = 0; i < resultItems.length; i++) {
+ var result = resultItems[i];
+
+ if (result.type == 'log') {
+ messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
+ } else if (result.type == 'expect' && result.passed && !result.passed()) {
+ messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
+
+ if (result.trace.stack) {
+ messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
+ }
+ }
+ }
+
+ if (messagesDiv.childNodes.length > 0) {
+ this.detail.appendChild(messagesDiv);
+ this.dom.details.appendChild(this.detail);
+ }
+};
+
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/db962e6d/test/autotest/html/SuiteView.js
----------------------------------------------------------------------
diff --git a/test/autotest/html/SuiteView.js b/test/autotest/html/SuiteView.js
new file mode 100644
index 0000000..19a1efa
--- /dev/null
+++ b/test/autotest/html/SuiteView.js
@@ -0,0 +1,22 @@
+jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
+ this.suite = suite;
+ this.dom = dom;
+ this.views = views;
+
+ this.element = this.createDom('div', { className: 'suite' },
+ this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description)
+ );
+
+ this.appendToSummary(this.suite, this.element);
+};
+
+jasmine.HtmlReporter.SuiteView.prototype.status = function() {
+ return this.getSpecStatus(this.suite);
+};
+
+jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
+ this.element.className += " " + this.status();
+};
+
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
+