remove unused code

This commit is contained in:
j 2016-02-29 17:29:37 +05:30
parent 402eae8068
commit ef23e4ea93
2 changed files with 1 additions and 95 deletions

View file

@ -131,10 +131,6 @@ TextArea.prototype.fromSrt = function(txt) {
} }
} }
function strip(s) {
return s.replace(/^\s+|\s+$/g,"");
}
function formatEnc(data) { function formatEnc(data) {
var r = '', n = 1; var r = '', n = 1;
data.forEach(function(item) { data.forEach(function(item) {
@ -241,54 +237,6 @@ var Span = function(tcIn, tcOut, text, index) {
this.tcInMs = Ox.isString(tcOut) ? Ox.parseDuration(tcIn) : tcIn; this.tcInMs = Ox.isString(tcOut) ? Ox.parseDuration(tcIn) : tcIn;
} }
var SeekBar = function(elem) {
this.elem = $('#' + elem);
this.pointerId = "seekPointer";
this.width = this.elem.width();
this.init()
}
SeekBar.prototype.init = function() {
var that = this;
var e = $('<div />');
e.attr("id", that.pointerId);
e.draggable({
containment: 'parent',
axis: 'horizontally',
drag: function() {
clearInterval(videoListener);
var pos = that.get();
$('#timeCode').html(Ox.formatDuration(pos, 3));
},
stop: function() {
var pos = that.get();
Video.set(pos);
videoListener = setInterval(Video.listener, 250);
}
});
that.elem.append(e);
this.pointerElem = e;
}
//gets current time-code (int) of seekbar position
SeekBar.prototype.get = function() {
var cssPos = parseInt(this.pointerElem.css("left"));
var pos = parseInt((cssPos / this.width) * Video.player.duration);
return pos;
}
//sets seek bar css pos according to current time-code
SeekBar.prototype.set = function(seconds) {
var cssPos = parseInt((seconds / Video.player.duration) * this.width);
this.elem.css("left", cssPos + "px");
}
/*
var KeyboardController = function() {
this.
}
*/
var User = function() { var User = function() {
this.padmaUser = typeof user != 'undefined' ? user : null; this.padmaUser = typeof user != 'undefined' ? user : null;
this.hostname = 'chrome://speedtrans'; this.hostname = 'chrome://speedtrans';

View file

@ -1,6 +1,5 @@
function Player() { function Player() {
this.supportsOverlay = false; this.supportsOverlay = false;
this.muted = false;
} }
Player.prototype.init = function(elemID) { Player.prototype.init = function(elemID) {
//make overlay settings happy..., add a dummy element //make overlay settings happy..., add a dummy element
@ -11,7 +10,6 @@ Player.prototype.pause = function() { }
Player.prototype.get = function() { } Player.prototype.get = function() { }
Player.prototype.listener = function() { } Player.prototype.listener = function() { }
Player.prototype.set = function(pos) { } Player.prototype.set = function(pos) { }
Player.prototype.mute = function(pos) { }
Player.prototype.volUp = function() { } Player.prototype.volUp = function() { }
Player.prototype.volDown = function() { } Player.prototype.volDown = function() { }
Player.prototype.seekFwd = function(ms) { Player.prototype.seekFwd = function(ms) {
@ -26,15 +24,6 @@ Player.prototype.seekBack = function(ms) {
this.set(newMs); this.set(newMs);
} }
Player.prototype.unmute = function(pos) { }
/* Player.prototype.url = function(pos) {
var timecode = pos2npt(pos);
var link = video.url;
if(pos > 0)
link += "?t=npt:" + timecode;
return link;
};
*/
function VideoPlayer() { function VideoPlayer() {
this.supportsOverlay = true; this.supportsOverlay = true;
@ -63,23 +52,6 @@ VideoPlayer.prototype.volDown = function() {
} }
VideoPlayer.prototype.set = function(pos) { VideoPlayer.prototype.set = function(pos) {
/* var url = this.url(pos);
var autoplay = 'true';
if(this.isPlaying)
varautoplay = 'true';
if(this.player) {
var element = $(this.player);
this.player.pause();
} else {
var element = $('#' + playerID);
}
this.player = document.createElement('video');
this.player.id = playerID;
this.player.width = this.width;
this.player.height = this.height;
this.player.setAttribute('src', url);
//this.player.setAttribute('autoplay', autoplay);
element.replaceWith(this.player); */
this.player.currentTime = pos; this.player.currentTime = pos;
} }
@ -101,16 +73,6 @@ VideoPlayer.prototype.pause = function() {
this.player.pause(); this.player.pause();
} }
VideoPlayer.prototype.mute = function(pos) {
this.player.muted = true;
this.muted = true;
}
VideoPlayer.prototype.unmute = function(pos) {
this.player.muted = false;
this.muted = false;
}
VideoPlayer.prototype.togglePause = function() { VideoPlayer.prototype.togglePause = function() {
if (Video.isPlaying == true) { if (Video.isPlaying == true) {
Video.pause(); Video.pause();
@ -120,11 +82,7 @@ VideoPlayer.prototype.togglePause = function() {
} }
VideoPlayer.prototype.listener = function() { VideoPlayer.prototype.listener = function() {
var t = Video.get(); $('#timeCode').html(Ox.formatDuration(Video.get(), 3));
var npt = Ox.formatDuration(t, 3);
$('#timeCode').html(npt);
var seekBarPos = parseInt((t/Video.duration) * 320);
$('#seekPointer').css("left", seekBarPos + "px");
} }
VideoPlayer.prototype.setDuration = function(duration) { VideoPlayer.prototype.setDuration = function(duration) {