...

View Full Version : getting wmp object playState from iframe



DarkFact
09-30-2010, 12:00 AM
I have a wmp object in an iframe and I would like to get the playState from a function in the main page. What I want to do is something like this:

function getPlayState(); {
parent.iframe1.getElementById. Player.playState
if playState==0
void(0);
else {
parent.iframe1.showDiv23();
parent.iframe1.hideDiv();
}}

Of course this doesn't work because I don't really know what I'm doing. But I think it shows what I want it to do. It only has to work in IE because it's for an app I'm making in an IE based app specific browser.

I don't even know if this is possible; but if it is, could someone help me turn it into a working function.

Thanks in advance.

DarkFact
10-01-2010, 03:39 AM
I figured it out. In case anyone has the same question, this is how I made it work:


function getPlayState(){
var MediaPlayer=parent.iframe1.document.getElementById("Player");
if (MediaPlayer.playState==0 || MediaPlayer.playState==1) {void(0)}
else {
parent.iframe1.hideDiv();
parent.iframe2.showDiv4();
}}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum