Extension MediawikiPlayer running with Semantic MediaWiki(SMW) and Semantic Forms(SF)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Extension MediawikiPlayer running with Semantic MediaWiki(SMW) and Semantic Forms(SF)

Markus Deuter
Perhaps a similar problem is asked for many times so excuse boring you .... but let me try to explain my little project:

for a media collection I want to combine extension MediawikiPlayer(Version 0.3.0) with SMW(Version 1.7.0.2) and SF(Version 2.3.2) on MediaWiki(Version 1.17.0).

My template "MediawikiPlayer" is built like this:
...
 ===<mediaplayer width=800 height=600>http://myserver/FILES/Videos/{{{Filename}}}</mediaplayer>===
...

You can see that the filename realized with a SMW attribute. Target is to setup the attribute ''filename'' by a Sematic Form (and of course many other media properties like height, width, ...).

My SF form is build like this:
 {{#forminput:form=New video}}
 ...
 | {{{field|Filename|mandatory}}}
 ...
 {{{end template}}}

My wikipage for showing the video is built like this:
 {{MediawikiPlayer
 |Filename=Testvideo.flv
 }}

With this wikitext snippet, the template "MediawikiPlayer" is called. The attribute Filename is in this case set to "Testvideo.flv".

Error: unfortunately the SMW attribute is not replaced while parsing/rendering by its value. The video will not bee found ...

After parsing/rendering to HTML the page code (on IE8) is like this:
<script type='text/javascript' src="/mediawiki/extensions/MediawikiPlayer/jwplayer.js"></script> <script type='text/javascript'> // <![CDATA[ jwplayer("MWPlayer-1").setup({flashplayer: "/mediawiki/extensions/MediawikiPlayer/player.swf", width: "800", height: "600", allowfullscreen: "true", backcolor: "eeeeee", file: "http://myserver/FILES/Videos/{{{Filename}}}"}); // ]]></script>
file: "http://myserver/FILES/Videos/{{{Filename}}} should be
file: "http://myserver/FILES/Videos/Testvideo.flv

You can see, that the attribute is not changed. So the player gives a black screen with an error message.
I tried to move the rendering hook of MediawikiPlayer to another (let me say a 'later') point but this was not successfull.

It is clear, that this is not an error of the MediawikiPlayer extension, but SMW/SF are well used extensions in many wikis, aren't they? Perhaps others got trouble with this combination, too. Any soulution ?
Thanks in advance for any feedback, Markus D.

P.S. interested users may find a future solution also on the talk of MediawikiPlayer extension on
http://www.mediawiki.org/wiki/Extension_talk:MediawikiPlayer
Reply | Threaded
Open this post in threaded view
|

Re: Extension MediawikiPlayer running with Semantic MediaWiki(SMW) and Semantic Forms(SF)

Yaron Koren-2
Hi Markus,

This isn't actually an SMW-related issue. The problem is that tags,
like <mediaplayer>, don't usually parse their arguments, while parser
functions do. The easiest solution is to use the #tag function, built
into MediaWiki, which lets you call a tag as a parser function:

http://www.mediawiki.org/wiki/Help:Magic_words#Miscellaneous

So it would be something like:
{{#tag:mediaplayer|http://myserver/FILES/Videos/{{{Filename}}}|width=800|height=600}}

-Yaron

On Tue, Jun 12, 2012 at 5:33 PM, Markus Deuter <[hidden email]> wrote:

> Perhaps a similar problem is asked for many times so excuse boring you ....
> but let me try to explain my little project:
>
> for a media collection I want to combine extension MediawikiPlayer(Version
> 0.3.0) with SMW(Version 1.7.0.2) and SF(Version 2.3.2) on MediaWiki(Version
> 1.17.0).
>
> My template "MediawikiPlayer" is built like this:
> ...
>  ===<mediaplayer width=800
> height=600>http://myserver/FILES/Videos/{{{Filename}}}</mediaplayer>===
> ...
>
> You can see that the filename realized with a SMW attribute. Target is to
> setup the attribute ''filename'' by a Sematic Form (and of course many other
> media properties like height, width, ...).
>
> My SF form is build like this:
>  {{#forminput:form=New video}}
>  ...
>  | {{{field|Filename|mandatory}}}
>  ...
>  {{{end template}}}
>
> My wikipage for showing the video is built like this:
>  {{MediawikiPlayer
>  |Filename=Testvideo.flv
>  }}
>
> With this wikitext snippet, the template "MediawikiPlayer" is called. The
> attribute Filename is in this case set to "Testvideo.flv".
>
> Error: unfortunately the SMW attribute is not replaced while
> parsing/rendering by its value. The video will not bee found ...
>
> After parsing/rendering to HTML the page code (on IE8) is like this:
>
>
>
>
> file: "http://myserver/FILES/Videos/{{{Filename}}} should be
> file: "http://myserver/FILES/Videos/Testvideo.flv
>
> You can see, that the attribute is not changed. So the player gives a black
> screen with an error message.
> I tried to move the rendering hook of MediawikiPlayer to another (let me say
> a 'later') point but this was not successfull.
>
> It is clear, that this is not an error of the MediawikiPlayer extension, but
> SMW/SF are well used extensions in many wikis, aren't they? Perhaps others
> got trouble with this combination, too. Any soulution ?
> Thanks in advance for any feedback, Markus D.
>
> P.S. interested users may find a future solution also on the talk of
> MediawikiPlayer extension on
> http://www.mediawiki.org/wiki/Extension_talk:MediawikiPlayer
>
> --
> View this message in context: http://wikimedia.7.n6.nabble.com/Extension-MediawikiPlayer-running-with-Semantic-MediaWiki-SMW-and-Semantic-Forms-SF-tp4977576.html
> Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user



--
WikiWorks · MediaWiki Consulting · http://wikiworks.com

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Extension MediawikiPlayer running with Semantic MediaWiki(SMW) and Semantic Forms(SF)

Markus Deuter
Dear Yaron,
thank you very much for anwering !

> This isn't actually an SMW-related issue. The problem is that tags,
> like <mediaplayer>, don't usually parse their arguments, while parser
> functions do.

You are right, this is not an SMW problem. I feared that not parsing the arguments is the reason, too.

> {{#tag:mediaplayer|http://myserver/FILES/Videos/{{{Filename}}}|width=800|height=600}}

That is exactly the solution ! After copy&paste it worked :-)

Thank you very much....

Greetings from Germany !
Markus

P.S. I added the solution to http://www.mediawiki.org/wiki/Extension_talk:MediawikiPlayer#MediawikiPlayer_running_with_Semantic_MediaWiki.28SMW.29_and_Semantic_Forms.28SF.29