1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| <html>
<head>
<style type="text/css">
@import url('./style.css');
</style>
<script language="javascript" type="text/javascript">
<!--
/* define function that shows percentage of movie loaded */
function showProgress() {
var percentLoaded = 0 ;
percentLoaded = parseInt((document.movie4948f3ecad006.GetMaxTimeLoaded() / document.movie4948f3ecad006.GetDuration()) * 100);
document.getElementById("loadStatus").innerHTML=+percentLoaded + '%';
document.getElementById("loadStatus").style.width=percentLoaded + '%';
var rectangle = document.movie4948f3ecad006.GetRectangle();
var rectangle = rectangle.split(",");
document.movie4948f3ecad006.SetRectangle(rectangle);
document.getElementById("player").width=rectangle[2]+"px";
document.getElementById("player").height=rectangle[3]+"px";
document.getElementById("loadStatus").style.width=rectangle[2];
}
/* define function that executes when movie loading is complete */
function movieLoaded() {
var rectangle = document.movie4948f3ecad006.GetRectangle();
var rectangle = rectangle.split(",");
document.movie4948f3ecad006.SetRectangle(rectangle);
document.getElementById("player").width=rectangle[2]+"px";
document.getElementById("player").height=rectangle[3]+"px";
document.getElementById("movie4948f3ecad006").width=rectangle[2]+"px";
document.getElementById("movie4948f3ecad006").height=rectangle[3];
document.getElementById("loadStatus").style.width=rectangle[2];
}
function showTime(){
var current = document.movie4948f3ecad006.GetTime();
var max = document.movie4948f3ecad006.GetDuration();
var rate = (current/max)*100;
document.getElementById("played").style.width=rate+"%";
setTimeout("showTime()", 250);
}
function myAddListener(obj, evt, handler, captures) {
if ( document.addEventListener )
obj.addEventListener(evt, handler, captures);
else
// IE
obj.attachEvent('on' + evt, handler);
}
/* define functions that register each listener */
function RegisterListener(eventName, objID, embedID, listenerFcn) {
var obj = document.getElementById(objID);
if ( !obj )
obj = document.getElementById(embedID);
if ( obj )
myAddListener(obj, eventName, listenerFcn, false);
}
/* define a single function that registers all listeners to call onload */
function RegisterListeners() {
RegisterListener('qt_progress', 'movie4948f3ecad006', 'qtmovie_embed', showProgress);
RegisterListener('qt_load', 'movie4948f3ecad006', 'qtmovie_embed', movieLoaded);
RegisterListener('qt_play', 'movie4948f3ecad006', 'qtmovie_embed', showTime);
}
//-->
</script>
</head>
<body onload="RegisterListeners();">
<div class="player" id="player">
<object id="movie4948f3ecad006" name="movie4948f3ecad006" type="video/quicktime" codebase="http://www.apple.com/qtactivex/qtplugin.cab" autoplay="false" data="http://linux.duke.edu/~cegeddin/mov/rockwall.mov" controller="false" EnableJavaScript="true" postdomevents="true">
<param name="src" value="http://linux.duke.edu/~cegeddin/mov/rockwall.mov" style="behavior:url(#qt_event_source);">
</object>
<div id="loadStatus">
<div id="played" style="width:0;"></div>
</div>
<div id="control">
<a href="javascript:document.movie4948f3ecad006.Play();">play</a>
<a href="javascript:document.movie4948f3ecad006.Stop();">pause</a>
</div>
</div>
</body>
</html> |
Partager