Updated Media.js updated to pass in options parameter to play in order to continue to support looping on iOS updated onStatus to expect a MediaError object as value parameter when msg is MEDIA_ERROR
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/7a20d51f Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/7a20d51f Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/7a20d51f Branch: refs/heads/master Commit: 7a20d51f26068dedfc1fbc862d59cf5730473e84 Parents: 3ac086e Author: Becky Gibson <becka...@apache.org> Authored: Wed Mar 21 16:38:05 2012 -0400 Committer: Becky Gibson <becka...@apache.org> Committed: Wed Mar 21 16:38:05 2012 -0400 ---------------------------------------------------------------------- lib/plugin/Media.js | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/7a20d51f/lib/plugin/Media.js ---------------------------------------------------------------------- diff --git a/lib/plugin/Media.js b/lib/plugin/Media.js index 8d56da9..477ce06 100644 --- a/lib/plugin/Media.js +++ b/lib/plugin/Media.js @@ -68,8 +68,8 @@ Media.get = function(id) { /** * Start or resume playing audio file. */ -Media.prototype.play = function() { - exec(this.successCallback, this.errorCallback, "Media", "startPlayingAudio", [this.id, this.src]); +Media.prototype.play = function(options) { + exec(this.successCallback, this.errorCallback, "Media", "startPlayingAudio", [this.id, this.src, options]); }; /** @@ -175,7 +175,8 @@ Media.onStatus = function(id, msg, value) { } else if (msg === Media.MEDIA_ERROR) { if (media.errorCallback) { - media.errorCallback({"code":value}); + // value should be a MediaError object when msg == MEDIA_ERROR + media.errorCallback(value); } } else if (msg === Media.MEDIA_POSITION) {