[TIMOB-15675] Android: Setting the position of the audio playBack in audioPlayer
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-01-17T00:27:56.000+0000 |
Affected Version/s | Release 3.1.3 |
Fix Version/s | 2014 Sprint 01, 2014 Sprint 01 API, Release 3.3.0 |
Components | Android |
Labels | module_media, qe-testadded |
Reporter | Betty Tran |
Assignee | Sunila |
Created | 2013-11-06T15:46:52.000+0000 |
Updated | 2014-04-22T23:06:16.000+0000 |
Looks like Android version already has a method 'setTime' to set the position but this is not documented.
Exposed 'time' property like in sound. https://github.com/appcelerator/titanium_mobile/pull/5121
Test case var win = Ti.UI.createWindow({ layout: 'vertical', backgroundColor : "#FFF" }); var audioPlayer = Titanium.Media.createAudioPlayer({ allowBackground : true }); var button = Ti.UI.createButton({ title : 'Stop', width : 200 }); button.addEventListener('click', function() { audioPlayer.stop(); audioPlayer.release(); }); win.add(button); var button2 = Ti.UI.createButton({ title : 'Play', width : 200 }); button2.addEventListener('click', function() { audioPlayer.start(); }); win.add(button2); var button3 = Ti.UI.createButton({ title : 'Pause', width : 200 }); button3.addEventListener('click', function() { audioPlayer.pause(); }); win.add(button3); var button4 = Ti.UI.createButton({ title : 'getTime', width : 200 }); button4.addEventListener('click', function() { Ti.API.info("Time = " +audioPlayer.getTime()); }); win.add(button4); var button5 = Ti.UI.createButton({ title : 'setTime', width : 200 }); button5.addEventListener('click', function() { audioPlayer.setTime(audioPlayer.getTime()+18000); }); win.add(button5); audioPlayer.setUrl('Kalimba.mp3'); audioPlayer.start(); win.open();