JavaScript that controls the player does not work in Safari

Discussion in 'Windows Media Player' started by dimitris Pappus, Jul 12, 2011.

  1. 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="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;


    }
     
    dimitris Pappus, Jul 12, 2011
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.