[TIMOB-16787] iOS: AudioPlayer crashes with local mp3 files
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2016-10-19T12:06:00.000+0000 |
Affected Version/s | Release 3.2.2 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Krish |
Assignee | Eric Merriman |
Created | 2014-03-28T07:16:45.000+0000 |
Updated | 2017-03-24T21:57:15.000+0000 |
Description
Whenever I tried to play music on iOS Simulator, the app crashes. (The application close itself).
var win = Titanium.UI.createWindow({
title:'Audio Test',
backgroundColor:'#fff',
layout: 'vertical'
});
var startStopButton = Titanium.UI.createButton({
title:'Start/Stop Streaming',
top:10,
width:200,
height:40
});
var pauseResumeButton = Titanium.UI.createButton({
title:'Pause/Resume Streaming',
top:10,
width:200,
height:40,
enabled:false
});
win.add(startStopButton);
win.add(pauseResumeButton);
// allowBackground: true on Android allows the
// player to keep playing when the app is in the
// background.
var audioPlayer = Ti.Media.createAudioPlayer();
audioPlayer.url = '/dn2.mp3';
startStopButton.addEventListener('click',function() {
// When paused, playing returns false.
// If both are false, playback is stopped.
if (audioPlayer.playing || audioPlayer.paused)
{
audioPlayer.stop();
pauseResumeButton.enabled = false;
if (Ti.Platform.name === 'android')
{
audioPlayer.release();
}
}
else
{
audioPlayer.start();
pauseResumeButton.enabled = true;
}
});
pauseResumeButton.addEventListener('click', function() {
if (audioPlayer.paused) {
audioPlayer.start();
}
else {
audioPlayer.pause();
}
});
audioPlayer.addEventListener('progress',function(e) {
Ti.API.info('Time Played: ' + Math.round(e.progress) + ' milliseconds');
});
audioPlayer.addEventListener('change',function(e)
{
Ti.API.info('State: ' + e.description + ' (' + e.state + ')');
});
win.addEventListener('close',function() {
audioPlayer.stop();
if (Ti.Platform.osname === 'android')
{
audioPlayer.release();
}
});
win.open();
Found that it crashes when source (music file is stored in local) is local.
Moving this ticket to engineering for further evaluation as I can reproduce the crash with the provided test case. It is related but not duplicate of TIMOB-9409 because that is about inability to play mp3 files and this one just crashes the application.
Issue still exists with SDK Version 3.2.2 and 3.4.0 Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.2.2.GA Titanium SDK version 3.4.0.GA Appcelerator Studio, build: 3.3.0.201407111535 iOS SDK: 7.0.3
Cannot reproduce with Titanium SDK 5.5.1.GA and iOS 10 anymore.
Closing ticket as the issue cannot be reproduced and with reference to the previous comments.