无法在动态创建的Object标记中播放QT

时间:2012-06-05 17:37:55

标签: quicktime object-tag

我正在尝试通过动态创建OBJECT标记来使Quicktime插件播放rtsp流。我的页面包含一个带有事件处理程序的网格,用于捕获行单击事件以生成标记。出现Quicktime徽标,但不播放。然而,当我在表格中硬编码片段时,流会播放。有没有办法让QT播放流?

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>

提前致谢。

1 个答案:

答案 0 :(得分:0)

我得到了!!我从服务器加载了一个iframe,动态构建了src。加载的iframe调用此URL,其中服务器创建OBJECT元素,其中流ID作为RESTful参数发送。

第一个电话:@RequestMapping(value =“/ playback / {id}”)

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

第二次通话:@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>");