diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-17 00:54:13 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-17 00:54:13 +0000 |
commit | 092be7678b67552cb3161fe162242bf8d3aeed2f (patch) | |
tree | be0693f45b101252c370e40f6e84da2cd7a52f75 /src/example_smil.html | |
download | kmplayer-092be7678b67552cb3161fe162242bf8d3aeed2f.tar.gz kmplayer-092be7678b67552cb3161fe162242bf8d3aeed2f.zip |
Added old abandoned KDE3 version of kmplayer
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmplayer@1091557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/example_smil.html')
-rw-r--r-- | src/example_smil.html | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/example_smil.html b/src/example_smil.html new file mode 100644 index 0000000..c7a29da --- /dev/null +++ b/src/example_smil.html @@ -0,0 +1,59 @@ +<html><head><title>crash.html</title></head> +<script> +var entriecount = 0; +var currentid = -1; +function writeMenu(node, doc) { + if (!node) return; + if (node.nodeName == "video") { + var src = node.getAttribute("src"); + var title = node.getAttribute("title"); + if (!title || title == "") + title = "no title"; + doc.write("<tr><td id='" + entriecount + "'><a href=\"javascript:top.play(" + entriecount + ",'" + src + "')\">" + title + "</a></td></tr>"); + entriecount++; + } + for (var i = 0; i < node.childNodes.length; i++) + writeMenu(node.childNodes.item(i), doc); +} +function loadXML(url) { + try { + var xmldoc = document.implementation.createDocument("", "", null); + xmldoc.async = false; + xmldoc.load(url); + var doc = menuframe.document; + doc.open(); + doc.write("<html><style>\nbody {color:#a0a0a0;background-color:#323232;}\ntd {font-size:9pt;}\na {color:#fffff0;}\n</style><body bgcolor='#323232'><table>"); + entriecount = 0; + writeMenu(xmldoc.firstChild, doc); + doc.write("</table></body></html>"); + doc.close(); + doc = playerframe.document; + doc.open(); + doc.write("<html><body bgcolor='#161616'></body></html>"); + doc.close(); + } catch(ex) { + alert ("Error: " + ex); + } +} +function play(id, url) { + if (currentid > -1) { + var td = menuframe.document.getElementById(currentid); + td.style.backgroundColor = '#323232'; + } + var td = menuframe.document.getElementById(id); + td.style.backgroundColor = '#646464'; + currentid = id; + var doc = playerframe.document; + doc.open(); + doc.write("<html><body bgcolor='#161616'><embed type='video/x-ms-wmv' src='" + url + "' width='100%' height='100%'><script>\nfunction onFinished(){top.finished(" + id + ");}\n<\/script></embed></body></html>"); + doc.close(); +} +function finished(id) { + var td = menuframe.document.getElementById(id); + td.style.backgroundColor = '#323232'; +} +</script> +<frameset cols="200,*" onLoad="loadXML('file:/your-smil.xml')"> + <frame name="menuframe" src="about:blank"> + <frame name="playerframe" src="about:blank"> +</html> |