Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Media Player > JavaScript that controls the player does not work in Safari

Reply
Thread Tools Display Modes

JavaScript that controls the player does not work in Safari

 
 
dimitris Pappus
Guest
Posts: n/a

 
      07-12-2011
Hello everyone
I have a page with an embedded video on Windows media player, and
developed a javascript to control the video, only for Firefox, Safari
and Google Chrome.

The parties that control the play, stop, pause, volume, and fast
reverse fast forward work very well, but when I put a function that
advances the video marks the next and previous does not work in Safari
and in Google Chrome only works in Firefox and the worst and does not
accuse me errors simply does not work, then I do not know what to do
if someone can help me would greatly appreciate it
The codes are below

Code for embedded player


<div id="Dvideo" style="position:absolute; width:400px; height:266px;
z-index:3; visibility:hidden; left: 14px; top: 85px;">
<object
id="contentPlayer"
name="contentPlayer"
width="400"
height="266"
type="application/x-ms-wmp">

<param name="AnimationAtStart" value="0" />
<param name="AutoStart" value="0" />
<param name="CurrentMarker" value="0" />
<param name="EnablePositionControls"
value="true" />
<param name="EnableTracker" value="0" />
<param name="ShowAudioControls" value="0" />
<param name="ShowCaptioning" value="0" />
<param name="ShowControls" value="1" />
<param name="ShowDisplay" value="0" />
<param name="ShowGotoBar" value="0" />
<param name="ShowPositionControls"
value="0" />
<param name="ShowStatusBar" value="0" />
<param name="ShowTracker" value="0" />
<PARAM NAME="EnableContextMenu"
VALUE="false">
<param name="AllowChangeDisplaySize"
value="true" />
<PARAM NAME="CurrentPosition"
VALUE="false">
<param name="SRC" value="video.wmv" />
<param name="TransparentAtStart" value="1" /
>

<param name="uiMode" value="none"/>
<embed
src="video.wmv"
width="400"
height="266"
autostart="0"
type="application/x-ms-wmp"
id="contentPlayer"
name="contentPlayer"
showdisplay="0"
showcontrols="1"
animationatstart="0"
transparentatstart="1"
showstatusbar="0"
showtracker="0"
currentmarker="0"
CurrentPosition="0"
enablepositioncontrols="true"
enabletracker="0"
showcaptioning="0"
showaudiocontrols="0"
showgotobar="0"
EnableContextMenu="false"
AllowChangeDisplaySize="true"
uiMode="none"
showpositioncontrols="0"></embed>
</object>
</div>

javascript code




function play()
{
var player=document.getElementById('contentPlayer');
document.getElementById('DInfo').style.visibility = 'hidden'
document.getElementById('Dvideo').style.visibility = 'visible'
player.controls.play();


}

function pause()
{
var player=document.getElementById('contentPlayer');
player.controls.pause();

}

function stop()
{
var player=document.getElementById('contentPlayer');
document.getElementById('DInfo').style.visibility =
'visible'
document.getElementById('Dvideo').style.visibility = 'hidden'
player.controls.stop();

}
function Volume()
{
document.getElementById('contentPlayer').settings. volume =
document.getElementById('contentPlayer').settings. volume + 30 ;
}

function VolumeDown()
{
document.getElementById('contentPlayer').settings. volume =
document.getElementById('contentPlayer').settings. volume - 30 ;
}


function mute() {

var player = document.getElementById('contentPlayer');
var mutebutton = document.getElementById('bt4');

if (player.settings.mute) {
player.settings.mute = false;
return player.settings.volume + "%";
mutebutton.src ="../images/mute_false.gif";

} else {
player.settings.mute = true;
return "mute";
mutebutton.src ="../images/mute_true.gif";

}
}

function fastforward()
{
var player=document.getElementById('contentPlayer');
player.controls.fastForward();

}

function fastreverse()
{
var player = document.getElementById('contentPlayer');
player.controls.fastReverse();

}

function GoNextMarker (mymark)

{
var player = document.getElementById('contentPlayer');
var mymark = player.controls.currentMarker + 1
player.controls.currentMarker = mymark;


}

function GoPreviusMarker (mymark)

{
var player = document.getElementById('contentPlayer');
var mymark = player.controls.CurrentMarker - 1
player.controls.currentMarker = mymark;


}
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adjusting security settings in the Media Player via regedit Sean Windows Media Player 1 02-17-2010 08:03 PM
Does windows media player 11 work with XP HOME - (SP3)? caren Windows Media Player 1 02-04-2010 01:03 PM
Windows Media Player (WMP) ripping errors/problems/doesn't work baoshou Windows Media Player 0 12-29-2009 03:12 AM
Halo CE Multiplayer doesn't work when Parental controls enabled mbrownah Windows Vista Games 2 04-24-2007 04:38 PM
Does ANY MP3 player work in Vista? jim_from_il Windows Vista Hardware 8 04-15-2007 11:37 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59