incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [5/7] wp7 commit: added dispatch wrapper to setVolume
Date Wed, 18 Jul 2012 21:10:15 GMT
added dispatch wrapper to setVolume


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/commit/bb209323
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/tree/bb209323
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/diff/bb209323

Branch: refs/heads/master
Commit: bb209323ec355c2a5d8f23222f9c4db50137abbc
Parents: 4885f4a
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Tue Jul 17 15:11:41 2012 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Tue Jul 17 15:11:41 2012 -0700

----------------------------------------------------------------------
 templates/standalone/cordovalib/Commands/Media.cs |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/bb209323/templates/standalone/cordovalib/Commands/Media.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/Commands/Media.cs b/templates/standalone/cordovalib/Commands/Media.cs
index 3f1018b..389abb1 100644
--- a/templates/standalone/cordovalib/Commands/Media.cs
+++ b/templates/standalone/cordovalib/Commands/Media.cs
@@ -198,8 +198,18 @@ namespace WP7CordovaClassLib.Cordova.Commands
 
                 if (Media.players.ContainsKey(id))
                 {
-                    AudioPlayer player = Media.players[id];
-                    player.setVolume(volume);
+                    Deployment.Current.Dispatcher.BeginInvoke(() =>
+                    {
+                        try
+                        {
+                            AudioPlayer player = Media.players[id];
+                            player.setVolume(volume);
+                        }
+                        catch (Exception e)
+                        {
+                            DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR,
e.Message));
+                        }
+                    });
                 }
             }
             catch (Exception)


Mime
View raw message