开发者

How to embed video FROM Google Plus?

It gives me to "Copy embed HTML" code:

<object style="height: 390px; width: 640px"><param name="movie" 

value="https://www.youtube.com/v/picasacid?version=3"><param 

name开发者_JS百科="allowFullScreen" value="true"><param name="allowScriptAccess" 

value="always"><embed src="https://www.youtube.com/v/picasacid?version=3" 

type="application/x-shockwave-flash" allowfullscreen="true" 

allowScriptAccess="always" width="640" height="390"></object>

but when I put it on my blog it says "Movie not loaded...".


Google+ videos are stored as Picasa videos. They are served in a way that does not allow for easy embedding.

It would be easier for you to upload them to YouTube and embed using the YouTube code.

If you must use the Google+ version you can't use the player code in your Google+ feed because the video stream URL expires every 11 hours.

I did it in my website by periodically retrieving the video's RSS feed

https://picasaweb.google.com/data/feed/tiny/user/<<the video poster's userid>>/photoid/<<the video's id>>

and extracting the <media:content url="<<video source url>>">. You can easily achieve this using the Google Picasa Api. I make an AJAX call to get the stream URLs on each user's visit but I have very few visitors.

You get a URL for each video format.

You use these URLs to replace the URLs from the embed code you can get from inspecting the Google+ player.

<embed width="800" height="600" flashvars="fs=1&amp;hl=en&amp;autoplay=1&amp;ps=picasaweb&amp;fmt_list=<<your fmt_list>>&amp;fmt_stream_map=<<your fmt_stream_map>>&amp;playerapiid=uniquePlayerId&amp;video_id=picasacid&amp;t=1&amp;vq=large&amp;auth_timeout=86400000000" wmode="opaque" scale="noScale" bgcolor="#fff" allowscriptaccess="always" allowfullscreen="true" type="application/x-shockwave-flash" src="//www.youtube.com/get_player?enablejsapi=1&amp;vq=hd720">

The URLs are passed to the player in the embed's flashvar attribute. You need to replace the video formats list parameter: fmt_list and the stream URLs list : fmt_stream_map.

Keep in mind that the contents of the flashvar attributes are urlencoded and the contents of the fmt_list and fmt_stream_map, which you send inside the flashvar attribute, are also urlencoded so the fmt_list and fmt_stream_map end up doubly urlencoded.

I hope I was explicit enough.


I think you need to tell the player which video to load before it does. The urls in the embed code above point to the player, not the video.


You can try to extract the HTML directly from the google plus page of the video, inspecting the DOM of the page that shows the video.

I don't understand if it is allowed to post links, but i'll try. This is a page of my blog which describes how I did it. http://www.nicassio.it/daniele/blog/?p=27

Anyway, it's a kind of hack, it seems Google doesn't want us to share those videos outside G+.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜