KDP3 Info

1 reply [Last post]
Joined: 06/29/2009
Points: 93

Here is some code for embedding and using the new KDP3, (Note: callbacks and usage has changed drastically from that of KDP2)

<html>
        <head>
                <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
                <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject_src.js"></script>
                <script language="JavaScript" type="text/javascript">
                        var jsReady = false;
                        var shouldAlert = 1;
                       
                        /**/
                        $(document).ready(function() {
                                onPageReady();
                        });
                        /***/
                        function onPageReady (){
                                alert("page ready");
                                jsReady = true;
                        }
                       
                        function jsInterfaceReady(){
                                if (shouldAlert = 1 && jsReady) {
                                        alert("js ready");
                                        shouldAlert = 0;
                                }
                                return jsReady;
                        }
                        //------------------------------------------------------------------------------
                        // KDP SwfObject embed:
                        var flashvars = {};
                        flashvars.autoPlay = "true";
                        flashvars.entryId = "assets/DemoVideo.flv";
                        //flashvars.debugMode = "true";
                        flashvars.fileSystemMode = "true";
                        flashvars.widgetId = "_133292";
                        flashvars.partnerId = "133292";
                        flashvars.pluginDomain = "kdp3/plugins/";
                        flashvars.kml = "local";
                        flashvars.kmlPath = "assets/config.xml";
                        flashvars.sourceType = "url";
                        flashvars.externalInterfaceDisabled = "false";
                        flashvars.jsInterfaceReadyFunc = "jsInterfaceReady";
                        flashvars["full.skinPath"] = "assets/LightDoodleskin.swf";
                       
                        var params = { };
                        params.quality = "best";
                        params.wmode = "opaque";
                        params.allowfullscreen = "true";
                        params.allowscriptaccess = "always";
                        params.bgcolor = "#000000";
                       
                        var attributes = {};
                        attributes.id = "kdp";
                        attributes.name = "kdp";
                       
                        /**/
                        swfobject.embedSWF(
                                "kdp3.swf",
                                'videoContainer',
                                '400',
                                '300',
                                "10",
                                "/expressInstall.swf",
                                flashvars,
                                params,
                                attributes
                        );
                        /**/
                       
                </script>
        </head>
        <body><!-- can also replace jQuery ready func with onload="onPageReady()" -->
                <h3>Standalone KDP</h3>
                <div id="videoContainer" style="width:500px;height:300px;">
        </body>
</html>

Code courtesy of Zohar Babin

NOTE: attached file kdp-embed.xls needs to be renamed to kdp-embed.zip (or just extract it)

---Jeff

AttachmentSize
kdp-embed.xls866.64 KB
Joined: 06/29/2009
Points: 93

side note:
When posting I got this error:

user warning: Unknown column 'r.vid' in 'where clause' query: SELECT t.tid, t.name FROM drupalorg_term_data t INNER JOIN drupalorg_term_node r ON r.tid = t.tid WHERE t.vid = 3 AND r.vid = 6945 ORDER BY t.weight LIMIT 0, 1 in /web/org/includes/database.mysql.inc on line 174.