You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2015/12/01 21:34:55 UTC

cordova-plugin-media git commit: fix CB-9884 & CB-9885

Repository: cordova-plugin-media
Updated Branches:
  refs/heads/master 8074d73f4 -> 8ae0841d0


fix CB-9884 & CB-9885

add support for streaming url prefixes that do not end in a file
extension
add base requirements for enabling background audio in a windows app


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/8ae0841d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/8ae0841d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/8ae0841d

Branch: refs/heads/master
Commit: 8ae0841d0a6a13b38752693845f7e510512824eb
Parents: 8074d73
Author: ghenry22 <gh...@gmail.com>
Authored: Wed Oct 28 11:28:52 2015 +0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Dec 1 11:36:22 2015 -0800

----------------------------------------------------------------------
 src/windows/MediaProxy.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/8ae0841d/src/windows/MediaProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/MediaProxy.js b/src/windows/MediaProxy.js
index f85c5cb..fddec2c 100644
--- a/src/windows/MediaProxy.js
+++ b/src/windows/MediaProxy.js
@@ -32,6 +32,7 @@ var tempFolderAppDataBasePath = 'ms-appdata:///temp/',
 
 var PARAMETER_IS_INCORRECT = -2147024809;
 var SUPPORTED_EXTENSIONS = ['.mp3', '.wma', '.wav', '.cda', '.adx', '.wm', '.m3u', '.wmx', '.m4a'];
+var SUPPORTED_PREFIXES = ['http', 'https', 'rstp'];
 
 module.exports = {
     mediaCaptureMrg:null,
@@ -47,16 +48,19 @@ module.exports = {
 
         Media.prototype.node = null;
 
+        var prefix = args[1].split(':').shift();
         var extension = srcUri.extension;
         if (thisM.node === null) {
-            if (SUPPORTED_EXTENSIONS.indexOf(extension) === -1) {
+            if (SUPPORTED_EXTENSIONS.indexOf(extension) === -1 && SUPPORTED_PREFIXES.indexOf(prefix) === -1) {
                 lose && lose({ code: MediaError.MEDIA_ERR_ABORTED });
                 return false; // unable to create
             }
 
             // Don't create Audio object in case of record mode
             if (createAudioNode === true) {
-                thisM.node = new Audio(srcUri.absoluteCanonicalUri);
+                thisM.node = new Audio();
+                thisM.node.msAudioCategory = "BackgroundCapableMedia";
+                thisM.node.src = srcUri.absoluteCanonicalUri;
 
                 thisM.node.onloadstart = function () {
                     Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STARTING);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org