[TIMOB-24024] TIMOB8418 Music won't stop playing after exiting
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-11-10T19:23:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Lee Morris |
Assignee | Farzad Merzadyan |
Created | 2016-10-12T22:50:50.000+0000 |
Updated | 2016-11-10T19:23:20.000+0000 |
Description
For TIMOB8418, the app plays Dancing in the Street by Martha and the Vandellas. However, there is no way to stop the music playing. The track just carries on and you have to kill the Media Module application to stop it playing. This occurs on iOS (10.) and Android devices (6.0.1).
App.js
function askCalendarPermission(){
if (Ti.Calendar.hasCalendarPermissions()) {
Ti.Calendar.getAllCalendars();
askContactPermission();
} else {
Ti.Calendar.requestCalendarPermissions(function(e) {
if (e.success === true) {
Ti.API.info("Calendar Permissions Granted");
Ti.Calendar.getAllCalendars();
askContactPermission();
} else {
alert("Access denied, error: " + e.error);
}
});
}
}
function askContactPermission(){
if (Ti.Contacts.hasContactsPermissions()) {
Ti.Contacts.getAllPeople();
askCameraPermissions();
} else {
Ti.Contacts.requestContactsPermissions(function(e) {
if (e.success === true) {
Ti.API.info("Contacts Permissions Granted");
Ti.Contacts.getAllPeople();
askCameraPermissions();
} else {
alert("Access denied, error: " + e.error);
}
});
}
}
//Added camera permissions in the tiapp.xml for camera because permissions get added to the android manifest only if showCamera() is called below. But its not fesible here as opening a camera before app launches just to add camera permissions looks stupid.
function askCameraPermissions(){
if (Ti.Media.hasCameraPermissions()) {
require('ui').createApplicationTabGroup().open();
} else {
Ti.Media.requestCameraPermissions(function(e) {
if (e.success === true) {
Ti.API.info("Camera Permissions Granted");
require('ui').createApplicationTabGroup().open();
} else {
alert("Access denied, error: " + e.error);
}
});
}
}
askCalendarPermission();
Attachments
File | Date | Size |
---|---|---|
code TIMOB8418.docx | 2016-10-12T22:48:29.000+0000 | 70497 |
screenshot-1.png | 2016-10-13T20:12:33.000+0000 | 46789 |
Please provide a reproducible demo-code (best in a single app.js), thank you!
[~lmorris] The provided code is not related to this ticket (it's related to permissions in general), can you change it to the one you specified in your image?
Speaking for Android (not sure about iOS): Looks like setting allowBackground property, in Ti.Media.createAudioPlayer, to false does not stop audio when app is exited. The audio can be stopped or resumed by calling audioPlayer.stop() via button click and also the audio can be stopped if app is destroyed from open apps slider.
[~hansknoechel] This is what I have for app.js. You need to download a supported sound file and change the url: