comparison core.js @ 1530:61d5a6b05ab9

Fix Bug #1314
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Wed, 22 Jul 2015 14:04:08 +0100
parents 0aad915ab322
children 212b353a5cd3
comparison
equal deleted inserted replaced
1529:0aad915ab322 1530:61d5a6b05ab9
1946 1946
1947 this.update = function() { 1947 this.update = function() {
1948 // Update the playhead position, startPlay must be called 1948 // Update the playhead position, startPlay must be called
1949 if (this.timePerPixel > 0) { 1949 if (this.timePerPixel > 0) {
1950 var time = this.playbackObject.getCurrentPosition(); 1950 var time = this.playbackObject.getCurrentPosition();
1951 var width = 490; 1951 if (time > 0) {
1952 var pix = Math.floor(time/this.timePerPixel); 1952 var width = 490;
1953 this.scrubberHead.style.left = pix+'px'; 1953 var pix = Math.floor(time/this.timePerPixel);
1954 if (this.maxTime > 60.0) { 1954 this.scrubberHead.style.left = pix+'px';
1955 var secs = time%60; 1955 if (this.maxTime > 60.0) {
1956 var mins = Math.floor((time-secs)/60); 1956 var secs = time%60;
1957 secs = secs.toString(); 1957 var mins = Math.floor((time-secs)/60);
1958 secs = secs.substr(0,2); 1958 secs = secs.toString();
1959 mins = mins.toString(); 1959 secs = secs.substr(0,2);
1960 this.curTimeSpan.textContent = mins+':'+secs; 1960 mins = mins.toString();
1961 this.curTimeSpan.textContent = mins+':'+secs;
1962 } else {
1963 time = time.toString();
1964 this.curTimeSpan.textContent = time.substr(0,4);
1965 }
1961 } else { 1966 } else {
1962 time = time.toString(); 1967 this.scrubberHead.style.left = '0px';
1963 this.curTimeSpan.textContent = time.substr(0,4); 1968 if (this.maxTime < 60) {
1969 this.curTimeSpan.textContent = '0.00';
1970 } else {
1971 this.curTimeSpan.textContent = '00:00';
1972 }
1964 } 1973 }
1965 } 1974 }
1966 }; 1975 };
1967 1976
1968 this.interval = undefined; 1977 this.interval = undefined;
1969 1978
1970 this.start = function() { 1979 this.start = function() {
1971 if (this.playbackObject != undefined && this.interval == undefined) { 1980 if (this.playbackObject != undefined && this.interval == undefined) {
1972 this.interval = setInterval(function(){interfaceContext.playhead.update();},100); 1981 if (this.maxTime < 60) {
1982 this.interval = setInterval(function(){interfaceContext.playhead.update();},10);
1983 } else {
1984 this.interval = setInterval(function(){interfaceContext.playhead.update();},100);
1985 }
1973 } 1986 }
1974 }; 1987 };
1975 this.stop = function() { 1988 this.stop = function() {
1976 clearInterval(this.interval); 1989 clearInterval(this.interval);
1977 this.interval = undefined; 1990 this.interval = undefined;
1991 if (this.maxTime < 60) {
1992 this.curTimeSpan.textContent = '0.00';
1993 } else {
1994 this.curTimeSpan.textContent = '00:00';
1995 }
1978 }; 1996 };
1979 }; 1997 };
1980 1998
1981 // Global Checkers 1999 // Global Checkers
1982 // These functions will help enforce the checkers 2000 // These functions will help enforce the checkers