Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18900] iOS: Slider throws error on slide

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2015-05-26T02:45:31.000+0000
Affected Version/sRelease 4.0.0
Fix Version/sRelease 4.1.0
ComponentsiOS
Labelsqe-4.0.0
ReporterEric Wieber
AssigneeIngo Muschenetz
Created2015-05-12T22:34:22.000+0000
Updated2015-05-28T20:56:06.000+0000

Description

When adjusting a slider I get the below error:
[ERROR] :  Script Error {
[ERROR] :      column = 18457;
[ERROR] :      line = 1;
[ERROR] :      message = "undefined is not a function (evaluating 'a.seekToTime(d.value)')";
[ERROR] :      sourceURL = "file:///private/var/mobile/Containers/Bundle/Application/E048CFB7-E212-43C8-A9B5-10AFB6F573DC/MediaModule.app/acceptance.js";
[ERROR] :      stack = "i@file:///private/var/mobile/Containers/Bundle/Application/E048CFB7-E212-43C8-A9B5-10AFB6F573DC/MediaModule.app/acceptance.js:1:18457";
[ERROR] :  }
[ERROR] :  ErrorController is up. ABORTING open
[ERROR] :  Analytics error sending request: The request timed out.
*Steps to reproduce issue* 1. Create a new project with the below code 2. Run the app 3. Adjust the slider *Actual Results* The above error is thrown *Expected Results* No error is thrown.
var _window = Ti.UI.createWindow({backgroundColor:"white"});

var audioPlayer = Ti.Media.createAudioPlayer({
        url: 'http://tenminutepodcast.com/Audio/BitKillerJones.mp3',
    });

    var start = Ti.UI.createButton({
        title: 'START',
        top: 30,
        left: 10
    });
    var pause = Ti.UI.createButton({
        title: 'PAUSE',
        top: 30
    });
    var stop = Ti.UI.createButton({
        title: 'STOP',
        top: 30,
        right: 10
    });


    _window.add(start);
    _window.add(pause);
    _window.add(stop);

    var slider = Ti.UI.createSlider({
        min: 0,
        max: 612000,
        visible: false,
        width: '80%'
    })

    _window.add(slider);

    var updateOnProgress = false;
    audioPlayer.addEventListener('progress', function(e) {

        if (updateOnProgress) {
            slider.value = e.progress;
        }
    })


    function resetPlayer(e) {
        Ti.API.info('RESET PLAYER');
        audioPlayer.stop();
        slider.visible = false;
        updateOnProgress = false;
        slider.value = 0;
    }

    audioPlayer.addEventListener('change', function(e) {
        if (e.state == audioPlayer.STATE_STOPPED) {
            resetPlayer(e);
        }
    })

    start.addEventListener('click', function(e) {
        slider.visible = true;
        updateOnProgress = true;
        audioPlayer.start();
    })

    stop.addEventListener('click', resetPlayer)

    pause.addEventListener('click', function(e) {
        audioPlayer.pause();
    })

    slider.addEventListener('touchstart', function(e) {
        updateOnProgress = false;
    })

    function updateStream(e) {
        audioPlayer.seekToTime(slider.value);
        updateOnProgress = true;
    }

    slider.addEventListener('touchend', updateStream);
    slider.addEventListener('touchcancel', updateStream);
    
_window.open();

Comments

  1. Chee Kiat Ng 2015-05-26

    *seekToTime()* is not an existing method in *audioPlayer*. Resolving ticket as invalid.
  2. Ingo Muschenetz 2015-05-26

    [~cng] Can you please re-evaluate TIMOB-14552 in light of this?

JSON Source