/    Sign up×
Community /Pin to ProfileBookmark

Controls.currentPositionString Object problem

Hello:

I am having a frustrating time trying to retrieve the value from my object wmp, which has the id = VIDEO. I used MSDN sample, but it doesn’t seem to be working?

I have this so far:

[CODE]function DisplayRunTime() {
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/controlscurrentposition.asp
//var timer = window.setInterval(“RunTimeText.value = VIDEO.controls.currentPositionString”,1000);
//window.setInterval(“RunTimeText.value = VIDEO.controls.currentPositionString”,1000);
document.getElementById(‘RunTimeText’).value = VIDEO.controls.currentPositionString,1000;
}[/CODE]

Then in the body, I have an input tag such as this:

[CODE]<INPUT TYPE=”text” size=”20″ ID=”RunTimeText” NAME=”RunTimeText”>[/CODE]

I receive no value when I load the page, so could someone please assist? Thank you so much.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@biniciauthorJul 19.2006 — Hi again:

Ok, I have it working now, but I need some logic to display a default value when the video ends. I had to play around and use a <span> tag, which now gets the value of the video playing.

function DisplayRunTime() {

// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/controlscurrentposition.asp

//window.setInterval("RunTimeText.value = VIDEO.controls.currentPositionString",1000);

//document.getElementById('RunTimeText') = VIDEO.controls.currentPositionString,1000;

//RunTimeText.innerHTML = VIDEO.controls.currentPositionString + " | " + VIDEO.currentMedia.durationString +"<font color='#3A445C' size='1' face=verdana></font>";

// && VIDEO.playState == 3

if(VIDEO.currentMedia){

var timer = window.setInterval("RunTimeText.innerHTML = VIDEO.controls.currentPositionString",100);

//}else{

//if(VIDEO.currentPosition == VIDEO.currentMedia.durationString){

//RunTimeText.innerHTML = VIDEO.currentMedia.durationString;

//}

}

}

function DisplayDuration() {

if(VIDEO.currentMedia){

var duration = window.setInterval("DurationTimeText.innerHTML = VIDEO.currentMedia.durationString",100);

}

}

I am having an issue now, when the video stops or ends, it looses the counter. Please help.

<span id="RunTimeText">00:00</span>&nbsp;/&nbsp;<span id="DurationTimeText"></span>


Thanks!
×

Success!

Help @binici spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...