Embed YouTube videos without a YouTube link

as you know, when you embed a video on your web page, it works great, but if you click on any part of the screen, the YouTube website will open in a new window.

Is there a way to embed a youtube video on our website, but disable this YouTube website by tapping the screen to pause the video?

or you can play the video in another player’s handset.?

I am looking for a way around this.

any possibility in j-request, ajax, java script or PHP, mootools, etc. Thanks

+5
source share
6 answers

try the following:

API YouTube, &version=3 &something=xx;version=3

<object style="height: 390px; width: 640px">
<param name="movie" value="http://www.youtube.com/v/u1zgFlCw8Aw?version=3">
<param name="allowFullScreen" value="true">
<param name="allowScriptAccess" value="always">
<embed src="http://www.youtube.com/v/u1zgFlCw8Aw?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></object>
+7

. -, , http://blip.tv. FTP ( ) .

+7

( ):

JS: - JS api Google ( )

:

  • , : DIV ontop ( , / ). , (/// YouTube).

:  - Youtube - : youtube / YouTube

+1

JW-

<script type='text/javascript' src='swfobject.js'></script>
<div id='mediaspace'>This text will be replaced</div>

<script type='text/javascript'>
  var so = new SWFObject('http://astra.pcriot.com/videos/player.swf','ply','400','315','9','#000000');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','http://www.youtube.com/watch?v=YQmt8uHgIGY');
  so.write('mediaspace');
</script>
0

API Youtube script, .

<div videoID="" startTime="" endTime="" height="" width="" id="youtube"></div>

var n = "youtube";
var y = document.createElement('script');
y.type = "text/javascript";
y.src = "//www.youtube.com/iframe_api";
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(y, s);
var player;
var p = document.getElementById(n);
var st = p.getAttribute("startTime");
var et = p.getAttribute("endTime");
var vi = p.getAttribute("videoID");
var ph = p.getAttribute("height");
var pw = p.getAttribute("width");

function onYouTubeIframeAPIReady() {
    player = new YT.Player(n, {
        height: ph,width: pw,playerVars: {
            'rel': 0,
            'showinfo': 0,
            'hidecontrols': 1
        },

        events: {
            'onReady': lv
        }
    })
}

function lv(e) {
    e.target.cueVideoById({
        videoId: vi,startSeconds: st,endSeconds: et
    })
}
0

<iframe width="560" height="315" src="//www.youtube.com/embed/<?=$idtube?>?modestbranding=1&amp;;showinfo=0&amp;;autohide=1&amp;;rel=0&amp;;hd=1" frameborder="0" allowfullscreen></iframe>
0

All Articles