Dynamic DOM Sample
This sample shows how to make the plugin appear on a page by replacing the content of a div element on the fly.

DivX Web Player Plug-In Samples: Dynamic DOM Sample
Dynamic DOM Sample
This sample shows how to make the plugin appear on a page by replacing the content of a div element on the fly. |
||
To make the plug-in appear: - To make the plug-in disappear: | ||
|
This sample initially does not contain the plugin HTML code but instead contains a div element that has some text in it and that is named viewer.
<div id="viewer"></div>
The plugin code is inserted inside this div by a javascript funtion called showPlugin() and removed again by a function hidePlugin() as follows
<script>
function showPlugin()
{
src = '<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" ' +
'width="320" height="212" ' +
'codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab"> ' +
'<param name="src" value="../../videos/video2.divx" /> '+
'<embed type="video/divx" width="320" ' +
'height="212" src="../../videos/video2.divx" ' +
'pluginspage="http://go.divx.com/plugin/download/"></embed> ' +
'</object>';
obj = document.getElementById("viewer");
obj.innerHTML = src;
}
function hidePlugin()
{
obj = document.getElementById("viewer");
obj.innerHTML = '<font color="#FEFEFE"><br>'+
'The Plug-In will appear here<br><br></font>';
}
</script>
|
||