Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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="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...".

like image 783
Александр Ветров Avatar asked Sep 19 '11 17:09

Александр Ветров


1 Answers

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.

like image 138
iomihai Avatar answered Oct 04 '22 14:10

iomihai