navigator.notification.beep

wp8应用在cordova下关于navigator.notification.beep的问题

故事扮演 提交于 2020-03-12 17:04:34
打开org.apache.cordova.dialogs插件下的Notification.cs文件 将beep方法修改为: public void beep(string options) { string[] args = JSON.JsonHelper.Deserialize<string[]>(options); int times = int.Parse(args[0]); string resourcePath = BaseCommand.GetBaseURL() + "Plugins/org.apache.cordova.dialogs/notification-beep.wav"; StreamResourceInfo sri = Application.GetResourceStream(new Uri(resourcePath, UriKind.Relative)); if (sri != null) { SoundEffect effect = SoundEffect.FromStream(sri.Stream); SoundEffectInstance inst = effect.CreateInstance(); //添加的代码 if (times == 0) { inst.Volume = 0.0f; } ThreadPool