// Parse the video embed code into a struct
videoStruct = application.ptmultiMedia.mediaRenderService.parseEmbed("#items[1].values.embedcode#","#items[1].values.id#");
// call getCEData to retrieve the record by the ID field which contains a UUID
embedCodeArray = application.ptmultimedia.cedata.getCEData("multiMedia", "ID", "#items[1].values.id#", "selected");
if (not embedCodeArray[1].values.embedcode contains "http://www.youtube.com/watch") {
// fix the html
cleanEmbedCode = replace(embedCodeArray[1].values.embedcode,""","""","ALL");
WriteOutput("");
//Render the video
WriteOutput(cleanEmbedCode);
}
else {
/* This is an external youtube video and we can play these directly */
player = application.ptmultimedia.mediaService.renderJSPlayer(#items[1].values.id#);
WriteOutput(player);
}
WriteOutput("
");
WriteOutput(embedCodeArray[1].values.description);
WriteOutput("
");