を使用して Apps Script から HTML ページを提供しています
function doGet() {
return HtmlService.createHtmlOutputFromFile('Generic.html');
}
Generic.html では、いくつかのことを試しました。YouTube からの通常の「iframe」埋め込みは確実に機能しません。
<iframe width="420" height="315" src="http://www.youtube.com/embed/bTiUVMQV0Ko" frameborder="0" allowfullscreen></iframe>
YouTubeから「古いバージョンの埋め込み」を試しました:
<object width="420" height="315"><param name="movie" value="http://www.youtube.com/v/bTiUVMQV0Ko?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/bTiUVMQV0Ko?version=3&hl=en_US" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>
古いバージョンをサイトの html ページに直接埋め込むと (apps スクリプトを介して提供するのではなく)、Google ガジェットに変換され、次のようにコードが表示されます。
<img src="https://www.google.com/chart?chc=sites&cht=d&chdp=sites&chl=%5B%5BGoogle+Gadget%27%3D20%27f%5Cv%27a%5C%3D0%2710%27%3D419%270%27dim%27%5Cbox1%27b%5CF6F6F6%27fC%5CF6F6F6%27eC%5C0%27sk%27%5C%5B%22Embed+gadget%22%27%5D%27a%5CV%5C%3D12%27f%5C%5DV%5Cta%5C%3D10%27%3D0%27%3D420%27%3D312%27dim%27%5C%3D10%27%3D10%27%3D420%27%3D312%27vdim%27%5Cbox1%27b%5Cva%5CF6F6F6%27fC%5CC8C8C8%27eC%5C%27a%5C%5Do%5CLauto%27f%5C&sig=lwVR4P8OQYTVXxdmEdsObNHzN2M" data-igsrc="http://0.gmodules.com/ig/ifr?mid=0&synd=trogedit&url=http%3A%2F%2Fwww.gstatic.com%2Fsites-gadgets%2Fembed%2Fembed.xml&up_embed_snippet=%3Cobject%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20height%3D%22315%22%20width%3D%22420%22%3E%3Cparam%20name%3D%22movie%22%20value%3D%22http%3A%2F%2Fwww.youtube.com%2Fv%2FbTiUVMQV0Ko%3Fversion%3D3%26amp%3Bhl%3Den_US%22%20%2F%3E%3Cparam%20name%3D%22allowFullScreen%22%20value%3D%22true%22%20%2F%3E%3Cparam%20name%3D%22allowscriptaccess%22%20value%3D%22always%22%20%2F%3E%3Cembed%20allowfullscreen%3D%22true%22%20allowscriptaccess%3D%22always%22%20height%3D%22315%22%20src%3D%22http%3A%2F%2Fwww.youtube.com%2Fv%2FbTiUVMQV0Ko%3Fversion%3D3%26amp%3Bhl%3Den_US%22%20type%3D%22application%2Fx-shockwave-flash%22%20width%3D%22420%22%20%2F%3E%3C%2Fobject%3E&w=420&h=315" data-type="ggs-gadget" data-props="height:315;igsrc:http#58//0.gmodules.com/ig/ifr?mid=0&synd=trogedit&url=http%3A%2F%2Fwww.gstatic.com%2Fsites-gadgets%2Fembed%2Fembed.xml&up_embed_snippet=%3Cobject%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20height%3D%22315%22%20width%3D%22420%22%3E%3Cparam%20name%3D%22movie%22%20value%3D%22http%3A%2F%2Fwww.youtube.com%2Fv%2FbTiUVMQV0Ko%3Fversion%3D3%26amp%3Bhl%3Den_US%22%20%2F%3E%3Cparam%20name%3D%22allowFullScreen%22%20value%3D%22true%22%20%2F%3E%3Cparam%20name%3D%22allowscriptaccess%22%20value%3D%22always%22%20%2F%3E%3Cembed%20allowfullscreen%3D%22true%22%20allowscriptaccess%3D%22always%22%20height%3D%22315%22%20src%3D%22http%3A%2F%2Fwww.youtube.com%2Fv%2FbTiUVMQV0Ko%3Fversion%3D3%26amp%3Bhl%3Den_US%22%20type%3D%22application%2Fx-shockwave-flash%22%20width%3D%22420%22%20%2F%3E%3C%2Fobject%3E&w=420&h=315;mid:0;spec:http#58//www.gstatic.com/sites-gadgets/embed/embed.xml;up_embed_snippet:<object xmlns="http#58//www.w3.org/1999/xhtml" height="315" width="420"><param name="movie" value="http#58//www.youtube.com/v/bTiUVMQV0Ko?version=3&amp#59hl=en_US" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed allowfullscreen="true" allowscriptaccess="always" height="315" src="http#58//www.youtube.com/v/bTiUVMQV0Ko?version=3&amp#59hl=en_US" type="application/x-shockwave-flash" width="420" /></object>;width:420;" style="display:block;text-align:left;margin-right:auto;" class="igm" height="315" width="420">
これを私の Generic.html ページにも配置しようとしましたが、灰色の Google Gadget 画面が表示されます。
何か案は?(Google サイトと埋め込み/iframe の一般的な回避策のヒントを含む)
ありがとう!