PyBlosxom |
/SW/business/Drupal:
Youku & Tudou Videos in Drupal
For websites targeting users in mainland China, one of the issues is that many common services like Youtube and Google Video are blocked / censored from within China. For this specific case of video, there are a number of similar local Chinese video services that can be used instead.
Most ex-China video services seem to make it easy to embed their videos in other sites by prominently displaying a button which will generate the javascript code necessary for embedding a video in another site. For whatever reason, the Chinese sites do not seem to be so helpful.
First of all, in Drupal, turn on the PHP module. Then select "Create Content" and some content type to get to the content creation page. Select "PHP code" in the "Input Format" sub-section. And finally, for a youku[1] video, paste the following code into the content area:
This is the video generated by the above:
Youku video links are of the form http://v.youku.com/v_show/id_XMTkwNDgzMjE2.html
Note the part between the "id_" and the ".html", ie. XMTkwNDgzMjE2. This is the part of the link that must be swapped into the above code for XNDg5MTMwMDQ in order to make it work for a different video.
Similarly, for tudou[2] videos, use this code:
which produces this video:
Tudou video links are of the form http://www.tudou.com/programs/view/eD1xQ0WTlI8/
Swap "eD1xQ0WTlI8" in the latter link for "rsOg3YPXjDg" in the code above to make the code work for a different video.
[1] http://www.youku.com/
[2] http://www.tudou.com/
posted at: 03:02 | path: /SW/business/Drupal | permanent link to this entry