Welcome Guest Search | Active Topics | Sign In | Register

"Two-way binding" Slider Options
Jan-Dirk Koelewijn
Posted: Thursday, September 27, 2012 8:56:49 PM
Rank: Newbie
Groups: Member

Joined: 10/6/2011
Posts: 7
I'am using the slider for positioning a mp3-file.

The ClientSideOnValueChange event works fine:

function slider_value_changed(slider) {
ASPNetMedia.Audio("Audio1").SetPosition(slider.getValue());
}

Also while playing the mp3-file I like to move the thumb according to the position of the mp3-file.

I know there is a setValue() method.

function InitAudio() {
var thisAudio = "Audio1";
var myLabelDuration = "LabelDuration1";
var myLabelPosition = "LabelPosition1";
var myLabelTimeLeft = "LabelTimeLeft1";
ASPNetMedia.Audio(thisAudio).OnProgress = function () { SetAudioPosition(thisAudio, myLabelPosition, myLabelTimeLeft); }
ASPNetMedia.Audio(thisAudio).OnSeek = function () { SetAudioPosition(thisAudio, myLabelPosition, myLabelTimeLeft); }
ASPNetMedia.Audio(thisAudio).OnReady = function () { SetAudioDuration(thisAudio, myLabelDuration, myLabelTimeLeft); }
}

// the position changes after Progress or Seek

function SetAudioPosition(thisAudio, myLabelPosition, myLabelTimeLeft) {
var position = ASPNetMedia.Audio(thisAudio).GetPosition();
document.getElementById(myLabelPosition).innerHTML = ConvertTime(position); // Converts it to (hh:):mm:ss
???.setValue(position);
}

How should I use the setValue() method?


eo_support
Posted: Friday, September 28, 2012 1:33:42 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You would so something like this:

Code: JavaScript
eo_GetObject("Slider1").setValue(....);


Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.