+ Reply to Thread
Results 1 to 3 of 3

Thread: how to write embed code in dekiscript-xml

  1. #1

    Red face how to write embed code in dekiscript-xml

    Hi everyone,
    I am looking to write an extension that embeds videos from a custom location using a dekiscript xml-rpc service.

    The embed code I wish to return is something like given below. I am new to dekiscript xml and want to know how to wrap that message so that the wiki treats it as html and embeds the flashplayer object.

    I cannot use the media extension since I want to do a little more than just embed the movie . Besides I wanted to make sure I understand how the rpc message needs to be constructed in my python app.

    Thanks in advace. The raw "dummy" embed code is given below.

    <embed
    src="mediaplayer.swf"
    width="640"
    height="480"
    allowscriptaccess="always"
    allowfullscreen="true"
    flashvars="height=480&width=640&file=http://www.myvideosource.com/1/3c27578b9ad280a4e311466eaf9a62be.flv"
    />

  2. #2
    Join Date
    Feb 2007
    Location
    San Diego, CA
    Posts
    733

    Default

    If you want to see how you would write that kind of extension in C#, take a look at the media extension source code.

    To use DekiScript, you could start with something like:
    Code:
    <extension>
      <namespace></namespace>
    
      <function>
        <name>custommedia</name>
        <description>Returns an embedded video</description>
        <param name="video" type = "uri">video uri</param>
        <param name="width" type ="int">video width</param>
        <param name="height" type ="int">video height</param>
        <return>
          <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
            <body>
              <embed
                src="mediaplayer.swf"
                eval:width="args.width"
                eval:height="args.height"
                allowscriptaccess="always"
                allowfullscreen="true"
    eval:flashvars="'height='..args.height..'&amp;width='..args.width..'&amp;file='..args.video"
            />
            </body>
          </html>
        </return>
      </function>
    </extension>
    To re gister:
    Make sure to specify that it is a local service and type Extension.
    SID = http://services.mindtouch.com/deki/d.../12/dekiscript
    Add this config setting: manifest=<path>, where <path> is the location of the file containing the xml above.

  3. #3

    Smile

    Hey Thanks a tonne. I wrote a CGIHTTPServer.CGIHTTPRequestHandler class in python that sends the embed code wrapped in XML as required by the schema posted at http://wiki.opengarden.org/Deki_Wiki...g_languages%3f

    The HTTP-POST returns the following with the embed code wrapped as a type "list".
    This seemed a little funky i.e I first needed to use <value type="list"> before I used <value type="xml"> to wrap the html embed tag.

    The POST stuff is pasted below. Thanks for your help
    harijay

    <value type="list"><value type="xml">
    <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
    <body>
    <embed
    src="http://www.code-itch.com/flashplayer/mediaplayer.swf"
    width="640"
    height="480"
    allowscriptaccess="always"
    allowfullscreen="true"
    flashvars="height=480&amp;width=640&amp;file=http://www.bioscreencast.com/screencasts/150/872c43e328ac398ba84624c46b61936b.flv"/>
    </body>
    </html></value></value>

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts