youtube - Google drive embed NO iframe -


is there way embed google drive video without using iframes?

just can youtube video:

<object width="320" height="180">           <param name="movie" value="http://www.youtube.com/v/uhk6wfnda5s&amp;showinfo=0">           <param name="wmode" value="transparent">           <embed src="http://www.youtube.com/v/uhk6wfnda5s&amp;showinfo=0" type="application/x-shockwave-flash" wmode="transparent" width="320" height="180"> </object> 

the suggested embed code google docs (using iframe) is:

<iframe src="https://docs.google.com/file/d/0b7cq5xvluigrqljunuhpqvltz0u/preview" width="640" height="385"></iframe> 

it's possible not officially supported.

after study of result generated iframe embed google drive , iframe youtube i've digged youtube js player api , found out it's possible using swfobject embed

here code use add player object:

function yt_createplayer(divid, videoid) {      var params = {         allowscriptaccess: "always"     };      var atts = {         id: videoid     };      //build player url similar 1 specified youtube js player api     var videourl = '';     videourl += 'https://video.google.com/get_player?wmode=opaque&ps=docs&partnerid=30'; //basic url player     videourl += '&docid=' + videoid; //specify fileid ofthe file show     videourl += '&enablejsapi=1'; //enable youtube js api interact video editor     videourl += '&playerapiid=' + videoid; //give video player same name video future reference     videourl += '&cc_load_policy=0'; //no caption on video (not supported google drive videos)       swfobject.embedswf(videourl,divid, widthvideo, heightvideo, "8", null, null, null, null);  } 

you need fetch fileid google drive how (js or server side, can use gas servlet if want host site on google drive).

most of youtube player parameters works, , events control playing status js fired; youtube documentation works.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -