I can embed, at foreign sites, content stored at my site, but I would like to find the way of generating the embedding code automatically, and be able to display it for the user to be able to copy it and paste it at destination site, in the same way that yau can do it at youtube for instance:
This is the code I use to embed videos
<object width="667" height="375" type="application/x-shockwave-flash" data="http://www.exemple.com/sites/all/modules/fileframework/vendor/flowplayer/flowplayer-3.2.8.swf">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="quality" value="high">
<param name="bgcolor" value="#000000">
<param name="flashvars" value="config={"playlist":[{"url":"http://www.exemple.com/bitcache/8fec79b89f4846e1a27073312aa08cac60e6fdca?vid=12","autoPlay":true,"autoBuffering":true}],"playerId":"file-player-11-13969294","clip":{}}">
</object>
This is the code I use to embed not video files
<!--[if !IE]> <--><object type="application/x-shockwave-flash" data="http://www.exemple.com/bitcache/0a0474f3a25b4247e0352ea03565736416ff6550?vid=16" height="540" width="720"><!----> <!--[endif]---->
<!--[if IE]><object type="application/x-shockwave-flash" width="720" height="540" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><![endif]-->
<param name="movie" value="http://www.exemple.com/bitcache/0a0474f3a25b4247e0352ea03565736416ff6550?vid=16"></object>
This is the code i use to embed audio files:
<object data="http://exemple.com/sites/all/modules/fileframework/vendor/xspf_player/xspf_player_slim.swf?playlist_url=http:%2F%2Fexemple.com%2Fca%2Ffile_audio%2Fxspf%2Fab4f98a17053b59c29c89cf0c7f0583ed4097b80%2F23%2F23&player_title=Gustavo%20Cerati%20-%20Coraz%C3%B3n%20Delator" height="15" type="application/x-shockwave-flash" width="400"><param name="movie" value="http://exemple.com/sites/all/modules/fileframework/vendor/xspf_player/xspf_player_slim.swf?playlist_url=http:%2F%2Fexemple.com%2Fca%2Ffile_audio%2Fxspf%2Fab4f98a17053b59c29c89cf0c7f0583ed4097b80%2F23%2F23&player_title=Gustavo%20Cerati%20-%20Coraz%C3%B3n%20Delator" /></object></p>
In two first cases the information that changes is the bitcache string of the file followed by the node id:
- 8fec79b89f4846e1a27073312aa08cac60e6fdca?vid=12
- 3fa86e941cd86cadaefb52b35e55d956bf7d64b4?vid=19
In the case of the audio file, it is only needed the bitcache string
- ab4f98a17053b59c29c89cf0c7f0583ed4097b80
Any idea?
Thanks for helping
Comments
Comment #1
andrés chandía commentedBy the way, you can see the site in action at: http://parles.upf.edu/llocs/ceru
Comment #1.0
andrés chandía commentedsome minor changes and addition of some code
Comment #2
johanneshahn commentedhi,
i think u have to create a custom embed code like utube too.
u tube code looks like this
<iframe width="560" height="315" src="http://www.youtube.com/embed/Zs2O7PlhoYA" frameborder="0" allowfullscreen></iframe>now u only have to create a custom page on your website which only returns the video. may a custom page.
the url have to be the url to the video nid something like this
http://parles.upf.edu/llocs/ceru/mycustomvideopage/667
if u call directly the url from the utube embed code "http://www.youtube.com/embed/Zs2O7PlhoYA" u can watch the video.
(look at html source code, its only the video code)
Comment #3
andrés chandía commentedHi johanneshahn
I'm coming back to this work, I had to install organic group module because of the requirements of our institution.
About the embedding, I understand the idea, but do you have any tip on how should the custom page be, I mean
do I create a new content type? which fields should I include? should I insert some php code?, how do I link the file uploaded (video, presentation, sound) to the custom embedding page, etc.
Thanks for the advice.
Comment #3.0
andrés chandía commentedcorrections
Comment #4
andrés chandía commentedHI there,

I have arrived to a solution that I want to share, just for you to take it or improve it.
The solution implies the creation of a view and a page with php as input format. At the view I used rewrite to send the variables to the php page that will return the embedding code, I have named this page "embedding-code-generator".
This is how it looks the view block:
And this is how the generated code (the php page) looks like:

Here you have the view code (replace the www.exemple.com with your own site url before importing the view to your system):
And here you have the "embedding-code-generator" php page content (replace the www.exemple.com with your own site url before pasting the code to your system)::
Comment #5
gobinathmClosing the issue. It was inactive for a long time & it's related to a Drupal Version which is not supported anymore