0

how to use tv.mediaPlayer.onTimeIndexChanged

how to use tv.mediaPlayer.onTimeIndexChanged? There is not example or detailed description about it.

we want to update UI with with mp3 stream metadata.

Thanks in advance,
Leo

by
1 Reply
  • QUOTE (Leo @ May 19 2009, 10:46 PM) <{POST_SNAPBACK}>
    how to use tv.mediaPlayer.onTimeIndexChanged? There is not example or detailed description about it.

    we want to update UI with with mp3 stream metadata.



    Hi Leo,

    Ideally speaking, I would love to work with you directly and develop a Framework level KONtx.audioplayer which fulfills your needs which will also hopefully make your development easier (and that of other future developers creating audio widgets), but in lieu of that, the basic information you asked for is the following:

    tv.mediaPlayer.onTimeIndexChanged = function() {
    log("Current position: " + tv.mediaPlayer.timeIndex / 1000 + " seconds");
    log("Total duration: " + tv.mediaPlayer.duration/1000 + " seconds");
    }

    tv.mediaPlayer.load("http://my.domain.com/audio.mp3);
    tv.mediaPlayer.play();

    The onTimeIndexChanged function defined above will get called once per second and will write two log lines each second (aka noisy in this case).

    -Jeremy
    0

Recent Posts

in General - Yahoo! TV Widgets