Short description
The EmbedObject-Macro only works with objects that are attached to a wiki page, see MacroMarket/EmbedObject or HelpOnMacros/EmbedObject.
There are a lot of services that allows to embed mostly flash-films from their server like youtube or ustream.tv.
Example Youtube
The HTML should look like this (Why is the URL from youtube not allowed in this wiki?):
<object width="425" height="350"><param name="movie" value="http://www.y*utube.com/v/SWmehf9okWM"></param><param name="wmode" value="transparent"></param><embed src="http://www.y*utube.com/v/SWmehf9okWM" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
Example ustream.tv
The HTML should look like this (for the stream):
<embed width="416" height="340" flashvars="autoplay=true" src="http://ustream.tv/T12pR0aOs2YQxMP99AvhBg.usc" type="application/x-shockwave-flash" wmode="transparent" \>
or like this (for the chat):
<embed width="563" height="266" type="application/x-shockwave-flash" flashvars="channel=#WikiTreffen" pluginspage="http://www.adobe.com/go/getflashplayer" src="http://ustream.tv/IrcClient.swf"\>
At youtube the embed-tag is within an object-tag, I don't know why.
The syntax could be like this:
[[EmbedObject(http://www.y*utube.com/v/SWmehf9okWM, type="application/x-shockwave-flash" wmode="transparent" width="425" height="350")]]
It's the same mechanism like in the ImageLink Macro, where you can show either attached images or images from another server.
Other solutions
At Wordpress seems to be a special macro so you only have to write for example [ustream T12pR0aOs2YQxMP99AvhBg.usc]. This can be realized not very elegant but very simple in MoinMoin too. And it would be very comfortable for the user.
1 # -*- coding: iso-8859-1 -*- 2 """ 3 MoinMoin - UstreamTv Macro 4 5 A macro to embed Streams from ustream.tv on wiki pages. 6 7 Usage: [[UstreamTv(streamcode)]] 8 9 Parameters: 10 11 streamcode: The code of the stream you want to embed. You find this in the code in the string given under the video and marked as "Embed:". 12 13 Example: 14 15 [[UstreamTv(T12pR0aOs2YQxMP99AvhBg.usc)]] 16 17 The Code to embed given at ustream looks like this: 18 19 <embed width="416" height="340" flashvars="autoplay=true" src="http://ustream.tv/T12pR0aOs2YQxMP99AvhBg.usc" type="application/x-shockwave-flash" wmode="transparent" \> 20 21 @copyright: 2007 by MoinMoin:RalfZosel 22 @license: GNU GPL, see COPYING for details. 23 """ 24 25 from MoinMoin import wikiutil 26 27 def execute(macro, args): 28 streamcode = wikiutil.escape(args) 29 result = '<embed width="416" height="340" flashvars="autoplay=true" src="http://ustream.tv/%s" type="application/x-shockwave-flash" wmode="transparent" \>' % (streamcode) 30 return macro.formatter.rawHTML(result)
1 # -*- coding: iso-8859-1 -*- 2 """ 3 MoinMoin - UstreamTvCaht Macro 4 5 A macro to embed Chats from ustream.tv on wiki pages. 6 7 Usage: [[UstreamTvChat(channel)]] 8 9 Parameters: 10 11 channel: The name of the channel you want to embed. You find this this name in the string given under the chat-window marked as "Embed Chat:". The leading # must be removed. 12 13 Example: 14 15 [[UstreamTvChat(WikiTreffen)]] 16 17 The Code to embed given at ustream looks like this: 18 19 <embed width="563" height="266" type="application/x-shockwave-flash" flashvars="channel=#WikiTreffen" pluginspage="http://www.adobe.com/go/getflashplayer" src="http://ustream.tv/IrcClient.swf"\> 20 21 @copyright: 2007 by MoinMoin:RalfZosel 22 @license: GNU GPL, see COPYING for details. 23 """ 24 25 from MoinMoin import wikiutil 26 27 def execute(macro, args): 28 channel = wikiutil.escape(args) 29 result = '<embed width="563" height="266" type="application/x-shockwave-flash" flashvars="channel=#%s" pluginspage="http://www.adobe.com/go/getflashplayer" src="http://ustream.tv/IrcClient.swf"\>' % (channel) 30 return macro.formatter.rawHTML(result)
1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - YouTube Macro
4
5 A macro to embed YouTube-videos on wiki pages.
6
7 Usage: [[YouTube(videocode)]]
8
9 Parameters:
10
11 videocode: The code of the video you want to embed. You find this in the URL given next to the YouTube video.
12
13 Example:
14
15 [[YouTube(SWmehf9okWM)]]
16
17 The URL given at YouTube looks like this: http://www.youtube.com/watch?v=SWmehf9okWM
18
19 @copyright: 2007 by MoinMoin:RalfZosel
20 @license: GNU GPL, see COPYING for details.
21 """
22
23 from MoinMoin import wikiutil
24
25 def execute(macro, args):
26 videocode = wikiutil.escape(args)
27 result = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/%s"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/%s" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>' % (videocode, videocode)
28 return macro.formatter.rawHTML(result)
implemeted for 1.6 changeset:2141 abc1a26ca19e