Question

I'm trying to get the Quicktime plugin play a rtsp stream by dynamically creating the OBJECT tag. My page contains a grid with an event handler to capture row click event to generate the tag. The Quicktime logo appears, but does not play though. The stream however plays when I hard code the snippet within the table. Is there a way to get to the QT play to stream ?

grid.connect(grid, 'onClick', function(item) {
        var videoTag = '<OBJECT classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" id="qt"';
        videoTag += ' codebase="http://www.apple.com/qtactivex/qtplugin.cab"';
        videoTag += ' id="qt" width="180" height="196"';
        videoTag += '<param name="src" value="resources/images/ClickToPlay.png"/>';
        videoTag += '<param name="href" value="rtsp://172.21.57.125/archive/43137b8fa05eb1"/>';
        videoTag += '<param name="autohref" value="true"/>';
        videoTag += '<param name="target" value="myself"/>';
        videoTag += '<param name="controller" value="false"/>';
        videoTag += '</OBJECT>';

        dojo.place(videoTag, dojo.byId("player"), "only");
});

<div id="wrapper">
        <table align="center" border="1" spacing="2" style="width:100%; height:200px;">
            <tr><td id="player" align="center">
                Content goes here
            </td></tr>
        </table>
</div>

Thanks in advance.

Was it helpful?

Solution

I got this !! I got an Iframe to load from the server with the src constructed dynamically. The Iframe on load invokes this url wherein the server creates the OBJECT element with the stream id sent as RESTful parameter.

First call: @RequestMapping(value="/playback/{id}")

PrintWriter out = response.getWriter();
out.println("<iframe id=\"qtiframe\" src=\"resession/stream/" + id + "\" frameborder=\"0\" width=\"1000\" height=\"200\"></iframe>");

Second Call: @RequestMapping(value="/stream/{id}")

PrintWriter out = response.getWriter();
out.println("<html><body>");
out.println("<div id=\"wrapper\">");
out.println("<table align=\"center\" border=\"0\" spacing=\"0\" style=\"width:100%; height:160px;\">");
out.println("<tr><td id=\"player\" align=\"center\">");
out.println("<OBJECT classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" id=\"qt\"");
out.println(" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\"");
out.println(" id=\"qt\" width=\"200\" height=\"156\"");
out.println("<param name=\"src\" value=\"images/ClickToPlay.png\"/>");
out.println("<param name=\"href\" value=\"rtsp://172.21.57.125/archive/" + id + "\"/>");
out.println("<param name=\"autohref\" value=\"true\"/>");
out.println("<param name=\"target\" value=\"myself\"/>");
out.println("<param name=\"controller\" value=\"false\"/>");
out.println("</OBJECT>");
out.println("</td></tr>");
out.println("</table>");
out.println("</div>");
out.println("</body></html>");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top