1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

function playPause() Javascript HELP

Discussion in 'JavaScript' started by agrisdul, Dec 22, 2011.

  1. #1
    Hello. I need big problem, I need to create Advertisting showing up to player. My Embeded player is in iframe and i whant to show on pause my ads in player. please who cann create this?

    How is imposible add Embeded code in js?


    i need add here my ads code!


    function playPause() {

    THERE!!! goes ADS

    }
     
    agrisdul, Dec 22, 2011 IP
  2. manjifera

    manjifera Well-Known Member

    Messages:
    232
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    118
    #2
    use script like this.. call playpause function on click event..



    <script......

    function playPause() {
    var whhtml = document.getElementById("op").innerHTML;
    var html = "<embeded code here >";

    if(whhtml == "") { document.getElementById("op").innerHTML = html; }
    else { document.getElementById("op").innerHTML == "" }
    }
    </script >


    <div id="op"></div>
     
    manjifera, Dec 31, 2011 IP
  3. agrisdul

    agrisdul Member

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Hi, Thanks.. But in my Iframe page it not work :(

    can you please suggest code for me, look at my page:

    <html style="border: 0; padding: 0; margin: 0; width: 100%; height: 100%; overflow: hidden;">
    <head>
    <title>{{$data.title}}</title>
    </head>
    <body style="border: 0; padding: 0; margin: 0; width: 100%; height: 100%; overflow: hidden;">
    {{if $data.can_watch==1}}
    {{if $data.load_type_id==3}}
    {{$data.embed|smarty:nodefaults}}
    {{elseif $flashvars.video_url==''}}
    You are not allowed to watch this video.
    {{else}}
    <div style="width: 100%; height: 100%"><div id="kt_player" style="visibility: hidden">
    <a href="http://adobe.com/go/getflashplayer">This page requires Adobe Flash Player</a>
    </div></div>
    <script type="text/javascript" src="{{$config.project_url}}/player/swfobject.js"></script>
    <script type="text/javascript">
    /* <![CDATA[ */
    function getEmbed() {
    var embedCode = '<iframe width="{{$player_size_embed[0]}}" height="{{$player_size_embed[1]}}" src="{{$config.project_url}}/embed/{{$flashvars_embed.video_id}}" frameborder="0">';
    embedCode += '</iframe>';
    return embedCode;
    }

    function playPause() {

    THERE!!! goes ADS

    }


    var flashvars = {
    {{foreach name=data key=key item=item from=$flashvars}}
    {{$key}}: encodeURIComponent('{{$item|replace:"'":"\\'"}}'){{if !$smarty.foreach.data.last}}, {{/if}}
    {{/foreach}}
    };
    flashvars['js'] = '1';

    if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Opera") != -1) {
    var params = {allowfullscreen: 'true', allowscriptaccess: 'always'};
    } else {
    var params = {allowfullscreen: 'true', allowscriptaccess: 'always', wmode: 'transparent'};
    }

    var attributes = {id: 'kt_player', name: 'kt_player'};
    swfobject.embedSWF('{{$config.project_url}}/player/kt_player_{{$config.project_version}}.swfx', 'kt_player', '100%', '100%', '9.124.0', '{{$config.project_url}}/player/expressInstall.swf', flashvars, params, attributes);
    /* ]]> */
    </script>
    {{/if}}
    {{elseif $smarty.session.user_id>0}}
    This video is a private video uploaded by <a href="{{$config.project_url}}/members/{{$data.user_id}}/">{{$data.username}}</a>. Only {{$data.username}}'s friends can watch this video. Please visit <a href="{{$config.project_url}}/members/{{$data.user_id}}/">{{$data.username}}'s Profile</a> to add him (her) to your friends list!
    {{else}}
    This video is a private video uploaded by <a href="{{$config.project_url}}/members/{{$data.user_id}}/">{{$data.username}}</a>. Only active members can watch private videos.<br/><br/>Please <a href="{{$config.project_url}}/login.php">log in</a> or <a href="{{$config.project_url}}/signup.php">sign up</a> for free.
    {{/if}}
    </body>
    </html>
     
    agrisdul, Jan 1, 2012 IP