[ 
https://issues.apache.org/jira/browse/CB-13678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16290194#comment-16290194
 ] 

ASF GitHub Bot commented on CB-13678:
-------------------------------------

stevengill closed pull request #157: CB-13678: Remove deprecated platforms
URL: https://github.com/apache/cordova-plugin-media/pull/157
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index 991732e9..b5330c38 100644
--- a/README.md
+++ b/README.md
@@ -58,18 +58,10 @@ cordova plugin add cordova-plugin-media
 ## Supported Platforms
 
 - Android
-- BlackBerry 10
 - iOS
-- Windows Phone 7 and 8
-- Tizen
-- Windows 8
 - Windows
 - Browser
 
-## Windows Phone Quirks
-
-- Only one media file can be played back at a time.
-
 ## Media
 
 ```js
@@ -464,10 +456,6 @@ setTimeout(function() {
 }, 5000);
 ```
 
-### BlackBerry 10 Quirks
-
-- Not supported on BlackBerry OS 5 devices.
-
 ## media.setVolume
 
 Set the volume for an audio file.
@@ -525,7 +513,6 @@ Starts recording an audio file.
 
 - Android
 - iOS
-- Windows Phone 7 and 8
 - Windows
 
 ### Quick Example
@@ -588,10 +575,6 @@ To add this entry into the `info.plist`, you can use the 
`edit-config` tag in th
 
 - Any subdirectory specified at record time must already exist.
 
-### Tizen Quirks
-
-- Not supported on Tizen devices.
-
 ## media.stop
 
 Stops playing an audio file.
@@ -636,7 +619,6 @@ Stops recording an audio file.
 
 - Android
 - iOS
-- Windows Phone 7 and 8
 - Windows
 
 ### Quick Example
@@ -668,10 +650,6 @@ function recordAudio() {
 }
 ```
 
-### Tizen Quirks
-
-- Not supported on Tizen devices.
-
 ## MediaError
 
 A `MediaError` object is returned to the `mediaError` callback
diff --git a/package.json b/package.json
index 7cfae7f6..682fc8d1 100644
--- a/package.json
+++ b/package.json
@@ -1,21 +1,15 @@
 {
   "name": "cordova-plugin-media",
-  "version": "4.0.1-dev",
+  "version": "5.0.0-dev",
   "description": "Cordova Media Plugin",
   "types": "./types/index.d.ts",
   "cordova": {
     "id": "cordova-plugin-media",
     "platforms": [
       "android",
-      "amazon-fireos",
-      "ubuntu",
+      "browser",
       "ios",
-      "blackberry10",
-      "wp7",
-      "wp8",
-      "windows8",
-      "windows",
-      "tizen"
+      "windows"
     ]
   },
   "repository": {
@@ -30,15 +24,9 @@
     "media",
     "ecosystem:cordova",
     "cordova-android",
-    "cordova-amazon-fireos",
-    "cordova-ubuntu",
+    "cordova-browser",
     "cordova-ios",
-    "cordova-blackberry10",
-    "cordova-wp7",
-    "cordova-wp8",
-    "cordova-windows8",
-    "cordova-windows",
-    "cordova-tizen"
+    "cordova-windows"
   ],
   "scripts": {
     "test": "npm run jshint",
diff --git a/plugin.xml b/plugin.xml
index ada69136..61ae3be0 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -21,7 +21,7 @@
 <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0";
 xmlns:android="http://schemas.android.com/apk/res/android";
 id="cordova-plugin-media"
-    version="4.0.1-dev">
+    version="5.0.0-dev">
 
     <name>Media</name>
     <description>Cordova Media Plugin</description>
@@ -64,39 +64,6 @@ id="cordova-plugin-media"
         <source-file src="src/android/FileHelper.java" 
target-dir="src/org/apache/cordova/media" />
     </platform>
 
-     <!-- amazon-fireos -->
-    <platform name="amazon-fireos">
-        <config-file target="res/xml/config.xml" parent="/*">
-            <feature name="Media" >
-                <param name="android-package" 
value="org.apache.cordova.media.AudioHandler"/>
-            </feature>
-        </config-file>
-
-        <config-file target="AndroidManifest.xml" parent="/*">
-            <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" />
-            <uses-permission 
android:name="android.permission.READ_PHONE_STATE" />
-        </config-file>
-
-        <source-file src="src/android/AudioHandler.java" 
target-dir="src/org/apache/cordova/media" />
-        <source-file src="src/android/AudioPlayer.java" 
target-dir="src/org/apache/cordova/media" />
-        <source-file src="src/android/FileHelper.java" 
target-dir="src/org/apache/cordova/media" />
-    </platform>
-
-
-    <!-- ubuntu -->
-    <platform name="ubuntu">
-        <config-file target="config.xml" parent="/*">
-            <feature name="Media">
-                <param policy_group="microphone" policy_version="1" />
-                <param policy_group="video" policy_version="1" />
-            </feature>
-        </config-file>
-        <header-file src="src/ubuntu/media.h" />
-        <source-file src="src/ubuntu/media.cpp" />
-    </platform>
-
     <!-- ios -->
     <platform name="ios">
         <config-file target="config.xml" parent="/*">
@@ -108,60 +75,6 @@ id="cordova-plugin-media"
         <source-file src="src/ios/CDVSound.m" />
     </platform>
 
-    <!-- blackberry10 -->
-    <platform name="blackberry10">
-        <source-file src="src/blackberry10/index.js" target-dir="Media" />
-        <config-file target="www/config.xml" parent="/widget">
-            <feature name="Media" value="Media"/>
-        </config-file>
-    </platform>
-
-    <!-- wp7 -->
-    <platform name="wp7">
-        <config-file target="config.xml" parent="/*">
-            <feature name="Media">
-                <param name="wp-package" value="Media"/>
-            </feature>
-        </config-file>
-
-        <config-file target="Properties/WMAppManifest.xml" 
parent="/Deployment/App/Capabilities">
-            <Capability Name="ID_CAP_MEDIALIB"/>
-            <Capability Name="ID_CAP_MICROPHONE"/>
-        </config-file>
-
-        <source-file src="src/wp/Media.cs" />
-        <source-file src="src/wp/AudioPlayer.cs" />
-    </platform>
-
-    <!-- wp8 -->
-    <platform name="wp8">
-        <config-file target="config.xml" parent="/*">
-            <feature name="Media">
-                <param name="wp-package" value="Media"/>
-            </feature>
-        </config-file>
-
-        <config-file target="Properties/WMAppManifest.xml" 
parent="/Deployment/App/Capabilities">
-            <Capability Name="ID_CAP_MEDIALIB_AUDIO"/>
-            <Capability Name="ID_CAP_MEDIALIB_PLAYBACK"/>
-            <Capability Name="ID_CAP_MICROPHONE"/>
-        </config-file>
-
-        <source-file src="src/wp/Media.cs" />
-        <source-file src="src/wp/AudioPlayer.cs" />
-    </platform>
-
-    <!-- windows8 -->
-    <platform name="windows8">
-        <js-module src="src/windows/MediaProxy.js" name="MediaProxy">
-            <runs />
-        </js-module>
-
-        <config-file target="package.appxmanifest" 
parent="/Package/Capabilities">
-            <DeviceCapability Name="microphone" />
-        </config-file>
-    </platform>
-
     <!-- windows -->
     <platform name="windows">
         <js-module src="src/windows/MediaProxy.js" name="MediaProxy">
@@ -173,13 +86,6 @@ id="cordova-plugin-media"
         </config-file>
     </platform>
 
-    <!-- tizen -->
-    <platform name="tizen">
-        <js-module src="src/tizen/MediaProxy.js" name="MediaProxy">
-            <runs/>
-        </js-module>
-    </platform>
-
     <!-- browser -->
     <platform name="browser">
         <js-module src="www/browser/Media.js" name="BrowserMedia">
diff --git a/src/blackberry10/index.js b/src/blackberry10/index.js
deleted file mode 100644
index e48fafa3..00000000
--- a/src/blackberry10/index.js
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- *
- * 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.
- *
-*/
-
-/* global qnx, PluginResult */
-
-var audioObjects = {},
-    mediaErrorsHandled = false;
-
-// There is a bug in the webplatform handling of media error
-// dialogs prior to 10.2. This function needs to be run once
-// on the webview which plays audio to prevent freezing.
-function handleMediaErrors() {
-    var webview = qnx.webplatform.getWebViews()[0],
-        handler = webview.onDialogRequested;
-    if (!mediaErrorsHandled) {
-        webview.allowWebEvent("DialogRequested");
-        webview.onDialogRequested = undefined;
-        webview.onDialogRequested = function (eventArgs) {
-            var parsedArgs = JSON.parse(eventArgs);
-            if (parsedArgs.dialogType === 'MediaError') {
-                return '{"setPreventDefault": true}';
-            }
-            handler(eventArgs);
-        };
-        mediaErrorsHandled = true;
-    }
-}
-
-module.exports = {
-
-    create: function (success, fail, args, env) {
-        var result = new PluginResult(args, env),
-            id;
-
-        if (!args[0]) {
-            result.error("Media Object id was not sent in arguments");
-            return;
-        }
-
-        id = JSON.parse(decodeURIComponent(args[0]));
-
-        if (!args[1]){
-            audioObjects[id] = new Audio();
-        } else {
-            audioObjects[id] = new 
Audio(JSON.parse(decodeURIComponent(args[1])));
-        }
-
-        handleMediaErrors();
-
-        result.ok();
-    },
-
-    startPlayingAudio: function (success, fail, args, env) {
-
-        var audio,
-            id,
-            result = new PluginResult(args, env);
-
-        if (!args[0]) {
-            result.error("Media Object id was not sent in arguments");
-            return;
-        }
-
-        id = JSON.parse(decodeURIComponent(args[0]));
-
-        audio = audioObjects[id];
-
-        if (!audio) {
-            result.error("Audio object has not been initialized");
-        } else {
-            audio.play();
-            result.ok();
-        }
-    },
-
-    stopPlayingAudio: function (success, fail, args, env) {
-
-        var audio,
-            id,
-            result = new PluginResult(args, env);
-
-        if (!args[0]) {
-            result.error("Media Object id was not sent in arguments");
-            return;
-        }
-
-        id = JSON.parse(decodeURIComponent(args[0]));
-
-        audio = audioObjects[id];
-
-        if (!audio) {
-            result.error("Audio Object has not been initialized");
-            return;
-        }
-
-        audio.pause();
-        audio.currentTime = 0;
-
-        result.ok();
-    },
-
-    seekToAudio: function (success, fail, args, env) {
-
-        var audio,
-            result = new PluginResult(args, env);
-
-        if (!args[0]) {
-            result.error("Media Object id was not sent in arguments");
-            return;
-        }
-
-        audio = audioObjects[JSON.parse(decodeURIComponent(args[0]))];
-
-        if (!audio) {
-            result.error("Audio Object has not been initialized");
-        } else if (!args[1]) {
-            result.error("Media seek time argument not found");
-        } else {
-            try {
-                audio.currentTime = JSON.parse(decodeURIComponent(args[1])) / 
1000;
-                result.ok();
-            } catch (e) {
-                result.error("Error seeking audio: " + e);
-            }
-        }
-    },
-
-    pausePlayingAudio: function (success, fail, args, env) {
-
-        var audio,
-            result = new PluginResult(args, env);
-
-        if (!args[0]) {
-            result.error("Media Object id was not sent in arguments");
-            return;
-        }
-
-        audio = audioObjects[JSON.parse(decodeURIComponent(args[0]))];
-
-        if (!audio) {
-            result.error("Audio Object has not been initialized");
-            return;
-        }
-
-        audio.pause();
-    },
-
-    getCurrentPositionAudio: function (success, fail, args, env) {
-
-        var audio,
-            result = new PluginResult(args, env);
-
-        if (!args[0]) {
-            result.error("Media Object id was not sent in arguments");
-            return;
-        }
-
-        audio = audioObjects[JSON.parse(decodeURIComponent(args[0]))];
-
-        if (!audio) {
-            result.error("Audio Object has not been initialized");
-            return;
-        }
-
-        result.ok(audio.currentTime);
-    },
-
-    getDuration: function (success, fail, args, env) {
-
-        var audio,
-            result = new PluginResult(args, env);
-
-        if (!args[0]) {
-            result.error("Media Object id was not sent in arguments");
-            return;
-        }
-
-        audio = audioObjects[JSON.parse(decodeURIComponent(args[0]))];
-
-        if (!audio) {
-            result.error("Audio Object has not been initialized");
-            return;
-        }
-
-        result.ok(audio.duration);
-    },
-
-    startRecordingAudio: function (success, fail, args, env) {
-        var result = new PluginResult(args, env);
-        result.error("Not supported");
-    },
-
-    stopRecordingAudio: function (success, fail, args, env) {
-        var result = new PluginResult(args, env);
-        result.error("Not supported");
-    },
-
-    release: function (success, fail, args, env) {
-        var audio,
-            id,
-            result = new PluginResult(args, env);
-
-        if (!args[0]) {
-            result.error("Media Object id was not sent in arguments");
-            return;
-        }
-
-        id = JSON.parse(decodeURIComponent(args[0]));
-
-        audio = audioObjects[id];
-
-        if (audio) {
-            if(audio.src !== ""){
-                audio.src = undefined;
-            }
-            audioObjects[id] = undefined;
-        }
-
-        result.ok();
-    }
-};
diff --git a/src/tizen/MediaProxy.js b/src/tizen/MediaProxy.js
deleted file mode 100644
index 15ab7f01..00000000
--- a/src/tizen/MediaProxy.js
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- *
- * 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.
- *
-*/
-
-/* global webkitURL */
-
-var Media = require('cordova-plugin-media.Media');
-
-var MediaError = require('cordova-plugin-media.MediaError'),
-    audioObjects = {};
-
-module.exports = {
-    // Initiates the audio file
-    create:function(successCallback, errorCallback, args) {
-        var id = args[0], src = args[1];
-
-        console.log("media::create() - id =" + id + ", src =" + src);
-
-        audioObjects[id] = new Audio(src);
-
-        audioObjects[id].onStalledCB = function () {
-            console.log("media::onStalled()");
-
-            audioObjects[id].timer = window.setTimeout(
-                    function () {
-                        audioObjects[id].pause();
-
-                        if (audioObjects[id].currentTime !== 0)
-                            audioObjects[id].currentTime = 0;
-
-                        console.log("media::onStalled() - MEDIA_ERROR -> " + 
MediaError.MEDIA_ERR_ABORTED);
-
-                        var err = new MediaError(MediaError.MEDIA_ERR_ABORTED, 
"Stalled");
-
-                        Media.onStatus(id, Media.MEDIA_ERROR, err);
-                    },
-                    2000);
-        };
-
-        audioObjects[id].onEndedCB = function () {
-            console.log("media::onEndedCB() - MEDIA_STATE -> MEDIA_STOPPED");
-
-            Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);
-        };
-
-        audioObjects[id].onErrorCB = function () {
-            console.log("media::onErrorCB() - MEDIA_ERROR -> " + 
event.srcElement.error);
-
-            Media.onStatus(id, Media.MEDIA_ERROR, event.srcElement.error);
-        };
-
-        audioObjects[id].onPlayCB = function () {
-            console.log("media::onPlayCB() - MEDIA_STATE -> MEDIA_STARTING");
-
-            Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STARTING);
-        };
-
-        audioObjects[id].onPlayingCB = function () {
-            console.log("media::onPlayingCB() - MEDIA_STATE -> MEDIA_RUNNING");
-
-            Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_RUNNING);
-        };
-
-        audioObjects[id].onDurationChangeCB = function () {
-            console.log("media::onDurationChangeCB() - MEDIA_DURATION -> " +  
audioObjects[id].duration);
-
-            Media.onStatus(id, Media.MEDIA_DURATION, 
audioObjects[id].duration);
-        };
-
-        audioObjects[id].onTimeUpdateCB = function () {
-            console.log("media::onTimeUpdateCB() - MEDIA_POSITION -> " +  
audioObjects[id].currentTime);
-
-            Media.onStatus(id, Media.MEDIA_POSITION, 
audioObjects[id].currentTime);
-        };
-
-        audioObjects[id].onCanPlayCB = function () {
-            console.log("media::onCanPlayCB()");
-
-            window.clearTimeout(audioObjects[id].timer);
-
-            audioObjects[id].play();
-        };
-
-    },
-
-    // Start playing the audio
-    startPlayingAudio:function(successCallback, errorCallback, args) {
-        var id = args[0], src = args[1], options = args[2];
-
-        console.log("media::startPlayingAudio() - id =" + id + ", src =" + src 
+ ", options =" + options);
-
-        audioObjects[id].addEventListener('canplay', 
audioObjects[id].onCanPlayCB);
-        audioObjects[id].addEventListener('ended', audioObjects[id].onEndedCB);
-        audioObjects[id].addEventListener('timeupdate', 
audioObjects[id].onTimeUpdateCB);
-        audioObjects[id].addEventListener('durationchange', 
audioObjects[id].onDurationChangeCB);
-        audioObjects[id].addEventListener('playing', 
audioObjects[id].onPlayingCB);
-        audioObjects[id].addEventListener('play', audioObjects[id].onPlayCB);
-        audioObjects[id].addEventListener('error', audioObjects[id].onErrorCB);
-        audioObjects[id].addEventListener('stalled', 
audioObjects[id].onStalledCB);
-
-        audioObjects[id].play();
-    },
-
-    // Stops the playing audio
-    stopPlayingAudio:function(successCallback, errorCallback, args) {
-        var id = args[0];
-
-        window.clearTimeout(audioObjects[id].timer);
-
-        audioObjects[id].pause();
-
-        if (audioObjects[id].currentTime !== 0)
-            audioObjects[id].currentTime = 0;
-
-        console.log("media::stopPlayingAudio() - MEDIA_STATE -> 
MEDIA_STOPPED");
-
-        Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);
-
-        audioObjects[id].removeEventListener('canplay', 
audioObjects[id].onCanPlayCB);
-        audioObjects[id].removeEventListener('ended', 
audioObjects[id].onEndedCB);
-        audioObjects[id].removeEventListener('timeupdate', 
audioObjects[id].onTimeUpdateCB);
-        audioObjects[id].removeEventListener('durationchange', 
audioObjects[id].onDurationChangeCB);
-        audioObjects[id].removeEventListener('playing', 
audioObjects[id].onPlayingCB);
-        audioObjects[id].removeEventListener('play', 
audioObjects[id].onPlayCB);
-        audioObjects[id].removeEventListener('error', 
audioObjects[id].onErrorCB);
-        audioObjects[id].removeEventListener('error', 
audioObjects[id].onStalledCB);
-    },
-
-    // Seeks to the position in the audio
-    seekToAudio:function(successCallback, errorCallback, args) {
-        var id = args[0], milliseconds = args[1];
-
-        console.log("media::seekToAudio()");
-
-        audioObjects[id].currentTime = milliseconds;
-        successCallback( audioObjects[id].currentTime);
-    },
-
-    // Pauses the playing audio
-    pausePlayingAudio:function(successCallback, errorCallback, args) {
-        var id = args[0];
-
-        console.log("media::pausePlayingAudio() - MEDIA_STATE -> 
MEDIA_PAUSED");
-
-        audioObjects[id].pause();
-
-        Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_PAUSED);
-    },
-
-    // Gets current position in the audio
-    getCurrentPositionAudio:function(successCallback, errorCallback, args) {
-        var id = args[0];
-        console.log("media::getCurrentPositionAudio()");
-        successCallback(audioObjects[id].currentTime);
-    },
-
-    // Start recording audio
-    startRecordingAudio:function(successCallback, errorCallback, args) {
-        var id = args[0], src = args[1];
-
-        console.log("media::startRecordingAudio() - id =" + id + ", src =" + 
src);
-
-        function gotStreamCB(stream) {
-            audioObjects[id].src = webkitURL.createObjectURL(stream);
-            console.log("media::startRecordingAudio() - stream CB");
-        }
-
-        function gotStreamFailedCB(error) {
-            console.log("media::startRecordingAudio() - error CB:" + 
error.toString());
-        }
-
-        if (navigator.webkitGetUserMedia) {
-            audioObjects[id] = new Audio();
-            navigator.webkitGetUserMedia('audio', gotStreamCB, 
gotStreamFailedCB);
-        } else {
-            console.log("webkitGetUserMedia not supported");
-        }
-        successCallback();
-    },
-
-    // Stop recording audio
-    stopRecordingAudio:function(successCallback, errorCallback, args) {
-        var id = args[0];
-
-        console.log("media::stopRecordingAudio() - id =" + id);
-
-        audioObjects[id].pause();
-        successCallback();
-    },
-
-    // Release the media object
-    release:function(successCallback, errorCallback, args) {
-        var id = args[0];
-        window.clearTimeout(audioObjects[id].timer);
-        console.log("media::release()");
-    },
-
-    setVolume:function(successCallback, errorCallback, args) {
-        var id = args[0], volume = args[1];
-
-        console.log("media::setVolume()");
-
-        audioObjects[id].volume = volume;
-    }
-};
-
-require("cordova/tizen/commandProxy").add("Media", module.exports);
diff --git a/src/ubuntu/media.cpp b/src/ubuntu/media.cpp
deleted file mode 100644
index 2814b5b3..00000000
--- a/src/ubuntu/media.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- *
- * 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.
- *
-*/
-
-#include "media.h"
-
-void Media::create(int scId, int ecId, const QString &id, const QString &src) {
-    Q_UNUSED(scId);
-    Q_UNUSED(ecId);
-
-    if (_id2Player.find(id) != _id2Player.end()) {
-        _id2Player[id]->stop();
-        _id2Player.remove(id);
-    }
-
-    _id2Player[id] = QSharedPointer<Player>(new Player(id, src, this));
-}
-
-void Media::relase(int scId, int ecId, const QString &id) {
-    Q_UNUSED(scId);
-    Q_UNUSED(ecId);
-
-    if (_id2Player.find(id) == _id2Player.end())
-        return;
-    _id2Player.remove(id);
-}
-
-void Media::startPlayingAudio(int scId, int ecId, const QString &id, const 
QString &src, QVariantMap options) {
-    Q_UNUSED(scId);
-    Q_UNUSED(ecId);
-    Q_UNUSED(src);
-    Q_UNUSED(options);
-
-    if (_id2Player.find(id) == _id2Player.end())
-        return;
-    QSharedPointer<Player> player = _id2Player[id];
-    player->play();
-}
-
-void Media::pausePlayingAudio(int scId, int ecId, const QString &id) {
-    Q_UNUSED(scId);
-    Q_UNUSED(ecId);
-
-    if (_id2Player.find(id) == _id2Player.end())
-        return;
-    QSharedPointer<Player> player = _id2Player[id];
-    player->pause();
-}
-
-void Media::stopPlayingAudio(int scId, int ecId, const QString &id) {
-    Q_UNUSED(scId);
-    Q_UNUSED(ecId);
-
-    if (_id2Player.find(id) == _id2Player.end())
-        return;
-    QSharedPointer<Player> player = _id2Player[id];
-    player->stop();
-}
-
-void Media::startRecordingAudio(int scId, int ecId, const QString &id, const 
QString &src) {
-    Q_UNUSED(scId);
-    Q_UNUSED(ecId);
-    Q_UNUSED(src);
-
-    if (_id2Player.find(id) == _id2Player.end())
-        return;
-    QSharedPointer<Player> player = _id2Player[id];
-    player->startRecording();
-}
-
-void Media::stopRecordingAudio(int scId, int ecId, const QString &id) {
-    Q_UNUSED(scId);
-    Q_UNUSED(ecId);
-
-    if (_id2Player.find(id) == _id2Player.end())
-        return;
-    QSharedPointer<Player> player = _id2Player[id];
-    player->stopRecording();
-}
-
-void Media::getCurrentPositionAudio(int scId, int ecId, const QString &id) {
-    Q_UNUSED(ecId);
-
-    if (_id2Player.find(id) == _id2Player.end())
-        return;
-
-    QSharedPointer<Player> player = _id2Player[id];
-    double position = player->getPosition();
-    this->cb(scId, position);
-}
-
-void Media::seekToAudio(int scId, int ecId, const QString &id, qint64 
position) {
-    Q_UNUSED(scId);
-    Q_UNUSED(ecId);
-
-    if (_id2Player.find(id) == _id2Player.end())
-        return;
-
-    QSharedPointer<Player> player = _id2Player[id];
-    player->seekTo(position);
-}
-
-void Media::setVolume(int scId, int ecId, const QString &id, int volume) {
-    Q_UNUSED(scId);
-    Q_UNUSED(ecId);
-
-    if (_id2Player.find(id) == _id2Player.end())
-        return;
-    QSharedPointer<Player> player = _id2Player[id];
-    player->setVolume(volume);
-}
diff --git a/src/ubuntu/media.h b/src/ubuntu/media.h
deleted file mode 100644
index c1f37122..00000000
--- a/src/ubuntu/media.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- *
- * 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.
- *
-*/
-
-#ifndef MEDIA_H_789768978
-#define MEDIA_H_789768978
-
-#include <QtMultimedia/QMediaPlayer>
-#include <QtCore>
-#include <QAudioRecorder>
-#include <QtMultimedia/QAudioEncoderSettings>
-
-#include <cplugin.h>
-#include <cordova.h>
-
-class Player;
-
-class Media: public CPlugin {
-    Q_OBJECT
-public:
-    explicit Media(Cordova *cordova): CPlugin(cordova) {
-    }
-
-    virtual const QString fullName() override {
-        return Media::fullID();
-    }
-
-    virtual const QString shortName() override {
-        return "Media";
-    }
-
-    static const QString fullID() {
-        return "Media";
-    }
-
-    enum State {
-        MEDIA_NONE = 0,
-        MEDIA_STARTING = 1,
-        MEDIA_RUNNING = 2,
-        MEDIA_PAUSED = 3,
-        MEDIA_STOPPED = 4
-    };
-    enum ErrorCode {
-        MEDIA_ERR_NONE_ACTIVE = 0,
-        MEDIA_ERR_ABORTED = 1,
-        MEDIA_ERR_NETWORK = 2,
-        MEDIA_ERR_DECODE = 3,
-        MEDIA_ERR_NONE_SUPPORTED = 4
-    };
-
-    void execJS(const QString &js) {
-        m_cordova->execJS(js);
-    }
-public slots:
-    void create(int scId, int ecId, const QString &id, const QString &src);
-    void relase(int scId, int ecId, const QString &id);
-
-    void startRecordingAudio(int scId, int ecId, const QString &id, const 
QString &src);
-    void stopRecordingAudio(int scId, int ecId, const QString &id);
-
-    void startPlayingAudio(int scId, int ecId, const QString &id, const 
QString &src, QVariantMap options);
-    void pausePlayingAudio(int scId, int ecId, const QString &id);
-    void stopPlayingAudio(int scId, int ecId, const QString &id);
-    void getCurrentPositionAudio(int scId, int ecId, const QString &id);
-    void seekToAudio(int scId, int ecId, const QString &id, qint64 position);
-    void setVolume(int scId, int ecId, const QString &id, int volume);
-
-private:
-    QMap<QString, QSharedPointer<Player> > _id2Player;
-};
-
-class Player: public QObject {
-    Q_OBJECT
-public:
-    Player(const QString &id, QString src, Media *plugin):
-        _state(Media::MEDIA_NONE),
-        _src(src),
-        _mode(MODE_NONE),
-        _plugin(plugin),
-        _id(id),
-        _stateChanged(false) {
-        QUrl url(src, QUrl::TolerantMode);
-
-        if (url.scheme().isEmpty()) {
-            QAudioEncoderSettings audioSettings;
-
-            _recorder.setEncodingSettings(audioSettings);
-            _recorder.setOutputLocation(QFileInfo(src).absoluteFilePath());
-
-            
_player.setMedia(QUrl::fromLocalFile(QFileInfo(src).absoluteFilePath()));
-        } else {
-            _player.setMedia(url);
-        }
-        QObject::connect(&_player, 
SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, 
SLOT(onMediaStatusChanged(QMediaPlayer::MediaStatus)));
-        QObject::connect(&_recorder, SIGNAL(error(QMediaRecorder::Error)), 
this, SLOT(onError(QMediaRecorder::Error)));
-
-        connect(&_timer, SIGNAL(timeout()), this, SLOT(reportPosition()));
-    }
-
-    void startRecording() {
-        if (recordMode() && _state != Media::MEDIA_RUNNING) {
-            _recorder.record();
-            setState(Media::MEDIA_RUNNING);
-        }
-    }
-    void stopRecording() {
-        if (recordMode() && _state == Media::MEDIA_RUNNING) {
-            _recorder.stop();
-            setState(Media::MEDIA_STOPPED);
-        }
-    }
-
-    void setVolume(int volume) {
-        _player.setVolume(volume);
-    }
-
-    void play() {
-        if (playMode() && _state != Media::MEDIA_RUNNING) {
-            _player.play();
-            setState(Media::MEDIA_RUNNING);
-        }
-    }
-    void pause() {
-        if (playMode() && _state == Media::MEDIA_RUNNING) {
-            _player.pause();
-            setState(Media::MEDIA_PAUSED);
-        }
-    }
-    void stop() {
-        if (playMode() && (_state == Media::MEDIA_RUNNING || _state == 
Media::MEDIA_PAUSED)) {
-            _player.stop();
-            setState(Media::MEDIA_STOPPED);
-        }
-    }
-    double getDuration() {
-        if (_mode == MODE_NONE || _player.duration() == -1)
-            return -1;
-        if (_mode != MODE_PLAY)
-            return -2;
-        return static_cast<double>(_player.duration()) / 1000.0;
-    }
-    double getPosition() {
-        if (_mode != MODE_PLAY)
-            return -1;
-        return static_cast<double>(_player.position()) / 1000.0;
-    }
-    bool seekTo(qint64 position) {
-        if (!_player.isSeekable())
-            return false;
-        _player.setPosition(position * 1000);
-        return true;
-    }
-private slots:
-    void reportPosition() {
-        double position = getPosition();
-        _plugin->execJS(QString("Media.onStatus('%1', Media.MEDIA_POSITION, 
%2)")
-                        .arg(_id).arg(position));
-        double duration = getDuration();
-        _plugin->execJS(QString("Media.onStatus('%1', Media.MEDIA_DURATION, 
%2)")
-                        .arg(_id).arg(duration));
-
-        if (_stateChanged && !(_state == Media::MEDIA_RUNNING && (duration == 
-1 || position == 0))) {
-        qCritical() << _id << "POSITION" << position << ":" << duration;
-            _stateChanged = false;
-            _plugin->execJS(QString("Media.onStatus('%1', Media.MEDIA_STATE, 
%2)").arg(_id).arg(_state));
-        }
-    }
-
-    void onMediaStatusChanged(QMediaPlayer::MediaStatus status) {
-        if (status == QMediaPlayer::InvalidMedia) {
-            reportError(Media::MEDIA_ERR_ABORTED, "AudioPlayer Error: The 
current media cannot be played.");
-            setState(Media::MEDIA_STOPPED);
-        }
-        if (status == QMediaPlayer::EndOfMedia) {
-            setState(Media::MEDIA_STOPPED);
-            seekTo(0);
-        }
-    }
-    void onError(QMediaRecorder::Error) {
-        reportError(Media::MEDIA_ERR_NONE_SUPPORTED, "AudioPlayer Error: 
Device is not ready or not available.");
-        setState(Media::MEDIA_STOPPED);
-    }
-
-private:
-    void reportError(int code, const QString &descr) {
-        Q_UNUSED(descr);
-        _plugin->execJS(QString("Media.onStatus('%1', Media.MEDIA_ERROR, 
{code: %2})")
-                        .arg(_id).arg(code));
-    }
-
-    bool playMode() {
-        switch (_mode) {
-        case Player::MODE_NONE:
-            _mode = MODE_PLAY;
-            break;
-        case Player::MODE_PLAY:
-            break;
-        case Player::MODE_RECORD:
-            reportError(Media::MEDIA_ERR_NONE_SUPPORTED, "AudioPlayer Error: 
Can't play in record mode.");
-            return false;
-            break;
-        }
-        return true;
-    }
-
-    bool recordMode() {
-        switch (_mode) {
-        case Player::MODE_NONE:
-            if (_recorder.outputLocation().isEmpty()) {
-                reportError(Media::MEDIA_ERR_NONE_SUPPORTED, "AudioPlayer 
Error: unsupported output location.");
-                return false;
-            }
-            _mode = MODE_RECORD;
-            break;
-        case Player::MODE_PLAY:
-            reportError(Media::MEDIA_ERR_NONE_SUPPORTED, "AudioPlayer Error: 
Can't play in play mode.");
-            return false;
-            break;
-        case Player::MODE_RECORD:
-            break;
-        }
-        return true;
-    }
-
-    void setState(Media::State state) {
-        _state = state;
-        _stateChanged = true;
-        _timer.start(250);
-    }
-
-    QMediaPlayer _player;
-
-    QAudioRecorder _recorder;
-    QTimer _timer;
-
-    Media::State _state;
-    QString _src;
-    enum Mode {
-        MODE_NONE,
-        MODE_PLAY,
-        MODE_RECORD
-    };
-    Mode _mode;
-    Media *_plugin;
-    QString _id;
-
-    bool _stateChanged;
-};
-
-#endif
diff --git a/src/wp/AudioPlayer.cs b/src/wp/AudioPlayer.cs
deleted file mode 100644
index 27366514..00000000
--- a/src/wp/AudioPlayer.cs
+++ /dev/null
@@ -1,648 +0,0 @@
-/*  
-       Licensed 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.
-*/
-
-using System;
-using System.IO;
-using System.IO.IsolatedStorage;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Threading;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Audio;
-using Microsoft.Xna.Framework.Media;
-using Microsoft.Phone.Controls;
-using System.Diagnostics;
-using System.Windows.Resources;
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
-
-    /// <summary>
-    /// Implements audio record and play back functionality.
-    /// </summary>
-    internal class AudioPlayer : IDisposable
-    {
-        #region Constants
-
-        // AudioPlayer states
-        private const int PlayerState_None = 0;
-        private const int PlayerState_Starting = 1;
-        private const int PlayerState_Running = 2;
-        private const int PlayerState_Paused = 3;
-        private const int PlayerState_Stopped = 4;
-
-        // AudioPlayer messages
-        private const int MediaState = 1;
-        private const int MediaDuration = 2;
-        private const int MediaPosition = 3;
-        private const int MediaError = 9;
-
-        // AudioPlayer errors
-        private const int MediaErrorPlayModeSet = 1;
-        private const int MediaErrorAlreadyRecording = 2;
-        private const int MediaErrorStartingRecording = 3;
-        private const int MediaErrorRecordModeSet = 4;
-        private const int MediaErrorStartingPlayback = 5;
-        private const int MediaErrorResumeState = 6;
-        private const int MediaErrorPauseState = 7;
-        private const int MediaErrorStopState = 8;
-
-        //TODO: get rid of this callback, it should be universal
-        //private const string CallbackFunction = "CordovaMediaonStatus";
-
-        #endregion
-
-
-        /// <summary>
-        /// The AudioHandler object
-        /// </summary>
-        private Media handler;
-
-        /// <summary>
-        /// Temporary buffer to store audio chunk
-        /// </summary>
-        private byte[] buffer;
-
-        /// <summary>
-        /// Xna game loop dispatcher
-        /// </summary>
-        DispatcherTimer dtXna;
-
-
-        /// <summary>
-        /// Output buffer
-        /// </summary>
-        private MemoryStream memoryStream;
-
-        /// <summary>
-        /// The id of this player (used to identify Media object in JavaScript)
-        /// </summary>
-        private String id;
-
-        /// <summary>
-        /// State of recording or playback
-        /// </summary>
-        private int state = PlayerState_None;
-
-        /// <summary>
-        /// File name to play or record to
-        /// </summary>
-        private String audioFile = null;
-
-        /// <summary>
-        /// Duration of audio
-        /// </summary>
-        private double duration = -1;
-
-        /// <summary>
-        /// Audio player object
-        /// </summary>
-        private MediaElement player = null;
-
-        /// <summary>
-        /// Audio source
-        /// </summary>
-        private Microphone recorder;
-
-        /// <summary>
-        /// Internal flag specified that we should only open audio w/o playing 
it
-        /// </summary>
-        private bool prepareOnly = false;
-
-        /// <summary>
-        /// Creates AudioPlayer instance
-        /// </summary>
-        /// <param name="handler">Media object</param>
-        /// <param name="id">player id</param>
-        public AudioPlayer(Media handler, String id)
-        {
-            this.handler = handler;
-            this.id = id;
-        }
-
-
-        /// <summary>
-        /// Destroys player and stop audio playing or recording
-        /// </summary>
-        public void Dispose()
-        {
-            if (this.player != null)
-            {
-                this.stopPlaying();
-                this.player = null;
-            }
-            if (this.recorder != null)
-            {
-                this.stopRecording();
-                this.recorder = null;
-            }
-
-            this.FinalizeXnaGameLoop();
-        }
-
-        private void InvokeCallback(int message, int value, bool removeHandler)
-        {
-            InvokeCallback(message, (double)value, removeHandler);
-        }
-
-        private void InvokeCallback(int message, double value, bool 
removeHandler)
-        {
-            var status = new Media.MediaStatus()
-            {
-                Id = this.id,
-                MsgType = message
-            };
-
-            if (message == MediaError)
-            {
-                status.Value = new Media.MediaError() { Code = (int)value };
-            }
-            else
-            {
-                status.Value = value;
-            }
-
-            this.handler.ReportStatus(status);
-        }
-
-        /// <summary>
-        /// Starts recording, data is stored in memory
-        /// </summary>
-        /// <param name="filePath"></param>
-        public void startRecording(string filePath)
-        {
-            if (this.player != null)
-            {
-                InvokeCallback(MediaError, MediaErrorPlayModeSet, false);
-            }
-            else if (this.recorder == null)
-            {
-                try
-                {
-                    this.audioFile = filePath;
-                    this.InitializeXnaGameLoop();
-                    this.recorder = Microphone.Default;
-                    this.recorder.BufferDuration = 
TimeSpan.FromMilliseconds(500);
-                    this.buffer = new 
byte[recorder.GetSampleSizeInBytes(this.recorder.BufferDuration)];
-                    this.recorder.BufferReady += new 
EventHandler<EventArgs>(recorderBufferReady);
-                    MemoryStream stream  = new MemoryStream();
-                    this.memoryStream = stream;
-                    int numBits = 16;
-                    int numBytes = numBits / 8;
-
-                    // inline version from AudioFormatsHelper
-                    stream.Write(System.Text.Encoding.UTF8.GetBytes("RIFF"), 
0, 4);
-                    stream.Write(BitConverter.GetBytes(0), 0, 4);
-                    stream.Write(System.Text.Encoding.UTF8.GetBytes("WAVE"), 
0, 4);
-                    stream.Write(System.Text.Encoding.UTF8.GetBytes("fmt "), 
0, 4);
-                    stream.Write(BitConverter.GetBytes(16), 0, 4);
-                    stream.Write(BitConverter.GetBytes((short)1), 0, 2);
-                    stream.Write(BitConverter.GetBytes((short)1), 0, 2);
-                    
stream.Write(BitConverter.GetBytes(this.recorder.SampleRate), 0, 4);
-                    
stream.Write(BitConverter.GetBytes(this.recorder.SampleRate * numBytes), 0, 4);
-                    stream.Write(BitConverter.GetBytes((short)(numBytes)), 0, 
2);
-                    stream.Write(BitConverter.GetBytes((short)(numBits)), 0, 
2);
-                    stream.Write(System.Text.Encoding.UTF8.GetBytes("data"), 
0, 4);
-                    stream.Write(BitConverter.GetBytes(0), 0, 4);
-
-                    this.recorder.Start();
-                    FrameworkDispatcher.Update();
-                    this.SetState(PlayerState_Running);
-                }
-                catch (Exception)
-                {
-                    InvokeCallback(MediaError, MediaErrorStartingRecording, 
false);
-                    //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaError, 
MediaErrorStartingRecording),false);
-                }
-            }
-            else
-            {
-                InvokeCallback(MediaError, MediaErrorAlreadyRecording, false);
-                //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaError, 
MediaErrorAlreadyRecording),false);
-            }
-        }
-
-        /// <summary>
-        /// Stops recording
-        /// </summary>
-        public void stopRecording()
-        {
-            if (this.recorder != null)
-            {
-                if (this.state == PlayerState_Running)
-                {
-                    try
-                    {
-                        this.recorder.Stop();
-                        this.recorder.BufferReady -= recorderBufferReady;
-                        this.recorder = null;
-                        SaveAudioClipToLocalStorage();
-                        this.FinalizeXnaGameLoop();
-                        this.SetState(PlayerState_Stopped);
-                    }
-                    catch (Exception)
-                    {
-                        //TODO 
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// Starts or resume playing audio file
-        /// </summary>
-        /// <param name="filePath">The name of the audio file</param>
-        /// <summary>
-        /// Starts or resume playing audio file
-        /// </summary>
-        /// <param name="filePath">The name of the audio file</param>
-        public void startPlaying(string filePath)
-        {
-            if (this.recorder != null)
-            {
-                InvokeCallback(MediaError, MediaErrorRecordModeSet, false);
-                //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaError, 
MediaErrorRecordModeSet),false);
-                return;
-            }
-
-
-            if (this.player == null || 
this.player.Source.AbsoluteUri.LastIndexOf(filePath) < 0)
-            {
-                try
-                {
-                    // this.player is a MediaElement, it must be added to the 
visual tree in order to play
-                    PhoneApplicationFrame frame = 
Application.Current.RootVisual as PhoneApplicationFrame;
-                    if (frame != null)
-                    {
-                        PhoneApplicationPage page = frame.Content as 
PhoneApplicationPage;
-                        if (page != null)
-                        {
-                            Grid grid = page.FindName("LayoutRoot") as Grid;
-                            if (grid != null)
-                            {
-
-                                this.player = 
grid.FindName("playerMediaElement") as MediaElement;
-                                if (this.player == null) // still null ?
-                                {
-                                    this.player = new MediaElement();
-                                    this.player.Name = "playerMediaElement";
-                                    grid.Children.Add(this.player);
-                                    this.player.Visibility = 
Visibility.Visible;
-                                }
-                                if (this.player.CurrentState == 
System.Windows.Media.MediaElementState.Playing)
-                                {
-                                    this.player.Stop(); // stop it!
-                                }
-
-                                this.player.Source = null; // Garbage collect 
it.
-                                this.player.MediaOpened += MediaOpened;
-                                this.player.MediaEnded += MediaEnded;
-                                this.player.MediaFailed += MediaFailed;
-                            }
-                        }
-                    }
-
-                    this.audioFile = filePath;
-
-                    Uri uri = new Uri(filePath, UriKind.RelativeOrAbsolute);
-                    if (uri.IsAbsoluteUri)
-                    {
-                        this.player.Source = uri;
-                    }
-                    else
-                    {
-                        using (IsolatedStorageFile isoFile = 
IsolatedStorageFile.GetUserStoreForApplication())
-                        {
-                            if (!isoFile.FileExists(filePath))
-                            {
-                                // try to unpack it from the dll into isolated 
storage
-                                StreamResourceInfo fileResourceStreamInfo = 
Application.GetResourceStream(new Uri(filePath, UriKind.Relative));
-                                if (fileResourceStreamInfo != null)
-                                {
-                                    using (BinaryReader br = new 
BinaryReader(fileResourceStreamInfo.Stream))
-                                    {
-                                        byte[] data = 
br.ReadBytes((int)fileResourceStreamInfo.Stream.Length);
-
-                                        string[] dirParts = 
filePath.Split('/');
-                                        string dirName = "";
-                                        for (int n = 0; n < dirParts.Length - 
1; n++)
-                                        {
-                                            dirName += dirParts[n] + "/";
-                                        }
-                                        if (!isoFile.DirectoryExists(dirName))
-                                        {
-                                            isoFile.CreateDirectory(dirName);
-                                        }
-
-                                        using (IsolatedStorageFileStream 
outFile = isoFile.OpenFile(filePath, FileMode.Create))
-                                        {
-                                            using (BinaryWriter writer = new 
BinaryWriter(outFile))
-                                            {
-                                                writer.Write(data);
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                            if (isoFile.FileExists(filePath))
-                            {
-                                using (IsolatedStorageFileStream stream = new 
IsolatedStorageFileStream(filePath, FileMode.Open, isoFile))
-                                {
-                                    this.player.SetSource(stream);
-                                }
-                            }
-                            else
-                            {
-                                InvokeCallback(MediaError, 
MediaErrorPlayModeSet, false);
-                                //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaError, 1), false);
-                                return;
-                            }
-                        }
-                    }
-                    this.SetState(PlayerState_Starting);
-                }
-                catch (Exception e)
-                {
-                    Debug.WriteLine("Error in AudioPlayer::startPlaying : " + 
e.Message);
-                    InvokeCallback(MediaError, MediaErrorStartingPlayback, 
false);
-                    //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaError, 
MediaErrorStartingPlayback),false);
-                }
-            }
-            else
-            {
-                if (this.state != PlayerState_Running)
-                {
-                    this.player.Play();
-                    this.SetState(PlayerState_Running);
-                }
-                else
-                {
-                    InvokeCallback(MediaError, MediaErrorResumeState, false);
-                    //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaError, 
MediaErrorResumeState),false);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Callback to be invoked when the media source is ready for playback
-        /// </summary>
-        private void MediaOpened(object sender, RoutedEventArgs arg)
-        {
-            if (this.player != null)
-            {
-                this.duration = 
this.player.NaturalDuration.TimeSpan.TotalSeconds;
-                InvokeCallback(MediaDuration, this.duration, false);
-                //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaDuration, this.duration),false);
-                if (!this.prepareOnly)
-                {
-                    this.player.Play();
-                    this.SetState(PlayerState_Running);
-                }
-                this.prepareOnly = false;
-            }
-            else
-            {
-                // TODO: occasionally MediaOpened is signalled, but player is 
null
-            }
-        }
-
-        /// <summary>
-        /// Callback to be invoked when playback of a media source has 
completed
-        /// </summary>
-        private void MediaEnded(object sender, RoutedEventArgs arg)
-        {
-            this.SetState(PlayerState_Stopped);
-        }
-
-        /// <summary>
-        /// Callback to be invoked when playback of a media source has failed
-        /// </summary>
-        private void MediaFailed(object sender, RoutedEventArgs arg)
-        {
-            if (player != null)
-            {
-                player.Stop();
-            }
-            InvokeCallback(MediaError, MediaErrorStartingPlayback, false);
-            //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaError.ToString(), "Media 
failed"),false);
-        }
-
-        /// <summary>
-        /// Seek or jump to a new time in the track
-        /// </summary>
-        /// <param name="milliseconds">The new track position</param>
-        public void seekToPlaying(int milliseconds)
-        {
-            if (this.player != null)
-            {
-                TimeSpan tsPos = new TimeSpan(0, 0, 0, 0, milliseconds);
-                this.player.Position = tsPos;
-                InvokeCallback(MediaPosition, milliseconds / 1000.0f, false);
-                //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaPosition, milliseconds / 
1000.0f),false);
-            }
-        }
-
-        /// <summary>
-        /// Set the volume of the player
-        /// </summary>
-        /// <param name="vol">volume 0.0-1.0, default value is 0.5</param>
-        public void setVolume(double vol)
-        {
-            if (this.player != null)
-            {
-                this.player.Volume = vol;
-            }
-        }
-
-        /// <summary>
-        /// Pauses playing
-        /// </summary>
-        public void pausePlaying()
-        {
-            if (this.state == PlayerState_Running)
-            {
-                this.player.Pause();
-                this.SetState(PlayerState_Paused);
-            }
-            else
-            {
-                InvokeCallback(MediaError, MediaErrorPauseState, false);
-                //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaError, 
MediaErrorPauseState),false);
-            }
-        }
-
-
-        /// <summary>
-        /// Stops playing the audio file
-        /// </summary>
-        public void stopPlaying()
-        {
-            if ((this.state == PlayerState_Running) || (this.state == 
PlayerState_Paused))
-            {
-                this.player.Stop();
-
-                this.player.Position = new TimeSpan(0L);
-                this.SetState(PlayerState_Stopped);
-            }
-            //else // Why is it an error to call stop on a stopped media?
-            //{
-            //    this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaError, MediaErrorStopState), 
false);
-            //}
-        }
-
-        /// <summary>
-        /// Gets current position of playback
-        /// </summary>
-        /// <returns>current position</returns>
-        public double getCurrentPosition()
-        {
-            if ((this.state == PlayerState_Running) || (this.state == 
PlayerState_Paused))
-            {
-                double currentPosition = this.player.Position.TotalSeconds;
-                //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaPosition, 
currentPosition),false);
-                return currentPosition;
-            }
-            else
-            {
-                return 0;
-            }
-        }
-
-        /// <summary>
-        /// Gets the duration of the audio file
-        /// </summary>
-        /// <param name="filePath">The name of the audio file</param>
-        /// <returns>track duration</returns>
-        public double getDuration(string filePath)
-        {
-            if (this.recorder != null)
-            {
-                return (-2);
-            }
-
-            if (this.player != null)
-            {
-                return this.duration;
-
-            }
-            else
-            {
-                this.prepareOnly = true;
-                this.startPlaying(filePath);
-                return this.duration;
-            }
-        }
-
-        /// <summary>
-        /// Sets the state and send it to JavaScript
-        /// </summary>
-        /// <param name="state">state</param>
-        private void SetState(int state)
-        {
-            if (this.state != state)
-            {
-                InvokeCallback(MediaState, state, false);
-                //this.handler.InvokeCustomScript(new 
ScriptCallback(CallbackFunction, this.id, MediaState, state),false);
-            }
-
-            this.state = state;
-        }
-
-        #region record methods
-
-        /// <summary>
-        /// Copies data from recorder to memory storages and updates recording 
state
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void recorderBufferReady(object sender, EventArgs e)
-        {
-            this.recorder.GetData(this.buffer);
-            this.memoryStream.Write(this.buffer, 0, this.buffer.Length);
-        }
-
-        /// <summary>
-        /// Writes audio data from memory to isolated storage
-        /// </summary>
-        /// <returns></returns>
-        private void SaveAudioClipToLocalStorage()
-        {
-            if (memoryStream == null || memoryStream.Length <= 0)
-            {
-                return;
-            }
-
-            long position = memoryStream.Position;
-            memoryStream.Seek(4, SeekOrigin.Begin);
-            memoryStream.Write(BitConverter.GetBytes((int)memoryStream.Length 
- 8), 0, 4);
-            memoryStream.Seek(40, SeekOrigin.Begin);
-            memoryStream.Write(BitConverter.GetBytes((int)memoryStream.Length 
- 44), 0, 4);
-            memoryStream.Seek(position, SeekOrigin.Begin);
-
-            try
-            {
-                using (IsolatedStorageFile isoFile = 
IsolatedStorageFile.GetUserStoreForApplication())
-                {
-                    string directory = Path.GetDirectoryName(audioFile);
-
-                    if (!isoFile.DirectoryExists(directory))
-                    {
-                        isoFile.CreateDirectory(directory);
-                    }
-
-                    this.memoryStream.Seek(0, SeekOrigin.Begin);
-
-                    using (IsolatedStorageFileStream fileStream = 
isoFile.CreateFile(audioFile))
-                    {
-                        this.memoryStream.CopyTo(fileStream);
-                    }
-                }
-            }
-            catch (Exception)
-            {
-                //TODO: log or do something else
-                throw;
-            }
-        }
-
-        #region Xna loop
-        /// <summary>
-        /// Special initialization required for the microphone: XNA game loop
-        /// </summary>
-        private void InitializeXnaGameLoop()
-        {
-            // Timer to simulate the XNA game loop (Microphone is from XNA)
-            this.dtXna = new DispatcherTimer();
-            this.dtXna.Interval = TimeSpan.FromMilliseconds(33);
-            this.dtXna.Tick += delegate { try { FrameworkDispatcher.Update(); 
} catch { } };
-            this.dtXna.Start();
-        }
-        /// <summary>
-        /// Finalizes XNA game loop for microphone
-        /// </summary>
-        private void FinalizeXnaGameLoop()
-        {
-            // Timer to simulate the XNA game loop (Microphone is from XNA)
-            if (this.dtXna != null)
-            {
-                this.dtXna.Stop();
-                this.dtXna = null;
-            }
-        }
-
-        #endregion
-
-        #endregion
-    }
-}
diff --git a/src/wp/Media.cs b/src/wp/Media.cs
deleted file mode 100644
index b0d85b2b..00000000
--- a/src/wp/Media.cs
+++ /dev/null
@@ -1,678 +0,0 @@
-/*  
-       Licensed 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.
-*/
-
-using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-using System.Windows;
-using System.Diagnostics;
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
-    /// <summary>
-    /// Provides the ability to record and play back audio files on a device. 
-    /// </summary>
-    public class Media : BaseCommand
-    {
-        /// <summary>
-        /// Audio player objects
-        /// </summary>
-        private static Dictionary<string, AudioPlayer> players = new 
Dictionary<string, AudioPlayer>();
-
-        /// <summary>
-        /// Callback id for Media events channel
-        /// </summary>
-        private static string messageChannelCallbackId;
-
-        /// <summary>
-        /// Represents Media action options.
-        /// </summary>
-        [DataContract]
-        public class MediaOptions
-        {
-            /// <summary>
-            /// Audio id
-            /// </summary>
-            [DataMember(Name = "id", IsRequired = true)]
-            public string Id { get; set; }
-
-            /// <summary>
-            /// Path to audio file
-            /// </summary>
-            [DataMember(Name = "src")]
-            public string Src { get; set; }
-
-            /// <summary>
-            /// New track position
-            /// </summary>
-            [DataMember(Name = "milliseconds")]
-            public int Milliseconds { get; set; }
-
-            public string CallbackId { get; set; }
-        }
-
-        /// <summary>
-        /// Reperesent media channel status changed action
-        /// </summary>
-        [DataContract]
-        public class MediaChannelStatusAction
-        {
-            /// <summary>
-            /// Action type
-            /// </summary>
-            [DataMember(Name = "action", IsRequired = true)]
-            public string Action { get; set; }
-
-            /// <summary>
-            /// Status data
-            /// </summary>
-            [DataMember(Name = "status", IsRequired = true)]
-            public MediaStatus Status { get; set; }
-
-            /// <summary>
-            /// Initialize a new instance
-            /// </summary>
-            public MediaChannelStatusAction()
-            {
-                this.Action = "status";
-            }
-        }
-
-        /// <summary>
-        /// Represents Media error
-        /// </summary>
-        [DataContract]
-        public class MediaError
-        {
-            [DataMember(Name = "code", IsRequired = true)]
-            public int Code { get; set; }
-        }
-
-        /// <summary>
-        /// Represents Media status
-        /// </summary>
-        [DataContract]
-        [KnownType(typeof(MediaError))]
-        public class MediaStatus
-        {
-            /// <summary>
-            /// Audio player Id
-            /// </summary>
-            [DataMember(Name = "id", IsRequired = true)]
-            public string Id { get; set; }
-
-            /// <summary>
-            /// Status message type
-            /// </summary>
-            [DataMember(Name = "msgType", IsRequired = true)]
-            public int MsgType { get; set; }
-
-            /// <summary>
-            /// Status message value
-            /// </summary>
-            [DataMember(Name = "value")]
-            public dynamic Value { get; set; }
-        }
-
-        /// <summary>
-        /// Establish channel for Media events
-        /// </summary>
-        public void messageChannel(string options)
-        {
-            string[] optionsString = 
JSON.JsonHelper.Deserialize<string[]>(options);
-            messageChannelCallbackId = optionsString[0];
-        }
-
-        /// <summary>
-        /// Report Media status to JS
-        /// </summary>
-        public void ReportStatus(MediaStatus status)
-        {
-            PluginResult result = new PluginResult(PluginResult.Status.OK, new 
MediaChannelStatusAction() { Status = status });
-            result.KeepCallback = true;
-
-            DispatchCommandResult(result, messageChannelCallbackId);
-        }
-
-        /// <summary>
-        /// Releases the audio player instance to save memory.
-        /// </summary>  
-        public void release(string options)
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-            try
-            {
-                MediaOptions mediaOptions = new MediaOptions();
-
-                try
-                {
-                    string[] optionsString = 
JSON.JsonHelper.Deserialize<string[]>(options);
-                    mediaOptions.Id = optionsString[0];
-                    callbackId = mediaOptions.CallbackId = optionsString[1];
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION), callbackId);
-                    return;
-                }
-
-                if (!Media.players.ContainsKey(mediaOptions.Id))
-                {
-                    DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK, false), callbackId);
-                    return;
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        AudioPlayer audio = Media.players[mediaOptions.Id];
-                        Media.players.Remove(mediaOptions.Id);
-                        audio.Dispose();
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK, true), mediaOptions.CallbackId);
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), mediaOptions.CallbackId);
-                    }
-                });
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-            }
-        }
-
-        private AudioPlayer GetOrCreatePlayerById(string id)
-        {
-            AudioPlayer audio = null;
-
-            lock (Media.players)
-            {
-                if (!Media.players.TryGetValue(id, out audio))
-                {
-                    audio = new AudioPlayer(this, id);
-                    Media.players.Add(id, audio);
-                    Debug.WriteLine("Media Created in GetOrCreatePlayerById");
-                }
-            }
-            
-            
-
-            return audio;
-        }
-
-        /// <summary>
-        /// Starts recording and save the specified file 
-        /// </summary>
-        public void startRecordingAudio(string options)
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-            try
-            {
-                MediaOptions mediaOptions = new MediaOptions();
-
-                try
-                {
-                    string[] optionsString = 
JSON.JsonHelper.Deserialize<string[]>(options);
-                    mediaOptions.Id = optionsString[0];
-                    mediaOptions.Src = optionsString[1];
-                    callbackId = mediaOptions.CallbackId = optionsString[2];
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION), mediaOptions.CallbackId);
-                    return;
-                }
-
-                if (mediaOptions != null)
-                {
-
-                    Deployment.Current.Dispatcher.BeginInvoke(() =>
-                    {
-                        try
-                        {
-                            AudioPlayer audio;
-                            if (!Media.players.ContainsKey(mediaOptions.Id))
-                            {
-                                audio = new AudioPlayer(this, mediaOptions.Id);
-                                Media.players.Add(mediaOptions.Id, audio);
-                            }
-                            else
-                            {
-                                audio = Media.players[mediaOptions.Id];
-                            }
-
-                            if (audio != null)
-                            {
-                                audio.startRecording(mediaOptions.Src);
-                                DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK), mediaOptions.CallbackId);
-                            }
-                            else
-                            {
-                                DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR,
-                                                        "Error accessing 
AudioPlayer for key " + mediaOptions.Id), mediaOptions.CallbackId);
-                            }
-                            
-                            
-                        }
-                        catch (Exception e)
-                        {
-                            DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), mediaOptions.CallbackId);
-                        }
-
-                    });
-                }
-                else
-                {
-                    DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION), mediaOptions.CallbackId);
-                }
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-            }
-        }
-
-        /// <summary>
-        /// Stops recording and save to the file specified when recording 
started 
-        /// </summary>
-        public void stopRecordingAudio(string options)
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-
-            try
-            {
-                string[] optStrings = 
JSON.JsonHelper.Deserialize<string[]>(options);
-                string mediaId = optStrings[0];
-                callbackId = optStrings[1];
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        if (Media.players.ContainsKey(mediaId))
-                        {
-                            AudioPlayer audio = Media.players[mediaId];
-                            audio.stopRecording();
-                            Media.players.Remove(mediaId);
-                        }
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK), callbackId);
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-                    }
-                });
-            }
-            catch (Exception)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION), callbackId);
-            }
-        }
-
-        public void setVolume(string options) // id,volume
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-            try
-            {
-                string[] optionsString = 
JSON.JsonHelper.Deserialize<string[]>(options);
-                string id = optionsString[0];
-                double volume = 0.0d;
-                double.TryParse(optionsString[1], out volume);
-
-                callbackId = optionsString[2];
-
-                if (Media.players.ContainsKey(id))
-                {
-                    Deployment.Current.Dispatcher.BeginInvoke(() =>
-                    {
-                        try
-                        {
-                            AudioPlayer player = Media.players[id];
-                            player.setVolume(volume);
-                        }
-                        catch (Exception e)
-                        {
-                            DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-                        }
-                    });
-                }
-            }
-            catch (Exception)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION, 
-                                                        "Error parsing options 
into setVolume method"), callbackId);
-            }
-        }
-
-        // Some Audio Notes:
-        // In the Windows Phone Emulator, playback of video or audio content 
using the MediaElement control is not supported.
-        // While playing, a MediaElement stops all other media playback on the 
phone.
-        // Multiple MediaElement controls are NOT supported
-
-        // Called when you create a new Media('blah.wav') object in JS.
-        public void create(string options)
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-            try
-            {
-                MediaOptions mediaOptions;
-                try
-                {
-                    string[] optionsString = 
JSON.JsonHelper.Deserialize<string[]>(options);
-                    mediaOptions = new MediaOptions();
-                    mediaOptions.Id = optionsString[0];
-                    mediaOptions.Src = optionsString[1];
-                    callbackId = mediaOptions.CallbackId = optionsString[2];
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION,
-                                            "Error parsing options into create 
method"), callbackId);
-                    return;
-                }
-
-                GetOrCreatePlayerById(mediaOptions.Id);
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK), callbackId);
-
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-            }
-        }
-
-        /// <summary>
-        /// Starts or resume playing audio file 
-        /// </summary>
-        public void startPlayingAudio(string options)
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-            try
-            {
-                MediaOptions mediaOptions;
-                try
-                {
-                    string[] optionsString = 
JSON.JsonHelper.Deserialize<string[]>(options);
-                    mediaOptions = new MediaOptions();
-                    mediaOptions.Id = optionsString[0];
-                    mediaOptions.Src = optionsString[1];
-                    int msec = 0;
-                    if (int.TryParse(optionsString[2], out msec))
-                    {
-                        mediaOptions.Milliseconds = msec;
-                    }
-                    callbackId = mediaOptions.CallbackId = optionsString[3];
-
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION), callbackId);
-                    return;
-                }
-
-                AudioPlayer audio = GetOrCreatePlayerById(mediaOptions.Id);
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        audio.startPlaying(mediaOptions.Src);
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK), callbackId);
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-                    }
-                });
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-            }
-        }
-
-
-        /// <summary>
-        /// Seeks to a location
-        /// </summary>
-        public void seekToAudio(string options)
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    string[] optionsString = 
JSON.JsonHelper.Deserialize<string[]>(options);
-                    mediaOptions = new MediaOptions();
-                    mediaOptions.Id = optionsString[0];
-                    int msec = 0;
-                    if (int.TryParse(optionsString[1], out msec))
-                    {
-                        mediaOptions.Milliseconds = msec;
-                    }
-                    callbackId = mediaOptions.CallbackId = optionsString[2];
-
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION), callbackId);
-                    return;
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        if (Media.players.ContainsKey(mediaOptions.Id))
-                        {
-                            AudioPlayer audio = Media.players[mediaOptions.Id];
-                            audio.seekToPlaying(mediaOptions.Milliseconds);
-                        }
-                        else
-                        {
-                            Debug.WriteLine("ERROR: seekToAudio could not find 
mediaPlayer for " + mediaOptions.Id);
-                        }
-
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK), callbackId);
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-                    }
-                });
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-            }
-        }
-
-        /// <summary>
-        /// Pauses playing 
-        /// </summary>
-        public void pausePlayingAudio(string options)
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-            try
-            {
-                string[] optionsString = 
JSON.JsonHelper.Deserialize<string[]>(options);
-                string mediaId = optionsString[0];
-                callbackId = optionsString[1]; 
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        if (Media.players.ContainsKey(mediaId))
-                        {
-                            AudioPlayer audio = Media.players[mediaId];
-                            audio.pausePlaying();
-                        }
-                        else
-                        {
-                            Debug.WriteLine("ERROR: pausePlayingAudio could 
not find mediaPlayer for " + mediaId);
-                        }
-
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK), callbackId);
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message),callbackId);
-                    }
-                });
-
-
-            }
-            catch (Exception)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION),callbackId);
-            }
-
-
-        }
-
-
-        /// <summary>
-        /// Stops playing the audio file
-        /// </summary>
-        public void stopPlayingAudio(String options)
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-            try
-            {
-                string[] optionsStrings = 
JSON.JsonHelper.Deserialize<string[]>(options);
-                string mediaId = optionsStrings[0];
-                callbackId = optionsStrings[1];
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        if (Media.players.ContainsKey(mediaId))
-                        {
-                            AudioPlayer audio = Media.players[mediaId];
-                            audio.stopPlaying();
-                        }
-                        else
-                        {
-                            Debug.WriteLine("stopPlaying could not find 
mediaPlayer for " + mediaId);
-                        }
-
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK), callbackId);
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-                    }
-                });
-
-            }
-            catch (Exception)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION), callbackId);
-            }
-        }
-
-        /// <summary>
-        /// Gets current position of playback
-        /// </summary>
-        public void getCurrentPositionAudio(string options)
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-            try
-            {
-                string[] optionsStrings = 
JSON.JsonHelper.Deserialize<string[]>(options);
-                string mediaId = optionsStrings[0];
-                callbackId = optionsStrings[1];
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        if (Media.players.ContainsKey(mediaId))
-                        {
-                            AudioPlayer audio = Media.players[mediaId];
-                            DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK, audio.getCurrentPosition()), callbackId);
-                        }
-                        else
-                        {
-                            DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK, -1), callbackId);
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-                    }
-                });
-            }
-            catch (Exception)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION), callbackId);
-                return;
-            }
-        }
-
-
-        /// <summary>
-        /// Gets the duration of the audio file
-        /// </summary>
-        
-        [Obsolete("This method will be removed shortly")]
-        public void getDurationAudio(string options)
-        {
-            string callbackId = this.CurrentCommandCallbackId;
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    string[] optionsString = 
JSON.JsonHelper.Deserialize<string[]>(options);
-
-                    mediaOptions = new MediaOptions();
-                    mediaOptions.Id = optionsString[0];
-                    mediaOptions.Src = optionsString[1];
-                    callbackId = mediaOptions.CallbackId = optionsString[2];
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION), callbackId);
-                    return;
-                }
-
-                AudioPlayer audio;
-                if (Media.players.ContainsKey(mediaOptions.Id))
-                {
-                    audio = Media.players[mediaOptions.Id];
-                }
-                else
-                {
-                    Debug.WriteLine("ERROR: getDurationAudio could not find 
mediaPlayer for " + mediaOptions.Id);
-                    audio = new AudioPlayer(this, mediaOptions.Id);
-                    Media.players.Add(mediaOptions.Id, audio);
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    DispatchCommandResult(new 
PluginResult(PluginResult.Status.OK, audio.getDuration(mediaOptions.Src)), 
callbackId);
-                });
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new 
PluginResult(PluginResult.Status.ERROR, e.Message), callbackId);
-            }
-        }
-    }
-}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Remove deprecated platforms from media plugin
> ---------------------------------------------
>
>                 Key: CB-13678
>                 URL: https://issues.apache.org/jira/browse/CB-13678
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-media
>            Reporter: Suraj Pindoria
>            Assignee: Suraj Pindoria
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to