From ef23e4ea93d42c85256a25c431655d17aafcd888 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 29 Feb 2016 17:29:37 +0530 Subject: [PATCH] remove unused code --- js/classes.js | 52 --------------------------------------------------- js/player.js | 44 +------------------------------------------ 2 files changed, 1 insertion(+), 95 deletions(-) diff --git a/js/classes.js b/js/classes.js index 088280a..cd8a677 100644 --- a/js/classes.js +++ b/js/classes.js @@ -131,10 +131,6 @@ TextArea.prototype.fromSrt = function(txt) { } } -function strip(s) { - return s.replace(/^\s+|\s+$/g,""); -} - function formatEnc(data) { var r = '', n = 1; data.forEach(function(item) { @@ -241,54 +237,6 @@ var Span = function(tcIn, tcOut, text, index) { 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 = $('
'); - 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() { this.padmaUser = typeof user != 'undefined' ? user : null; this.hostname = 'chrome://speedtrans'; diff --git a/js/player.js b/js/player.js index 959c233..e2027a6 100644 --- a/js/player.js +++ b/js/player.js @@ -1,6 +1,5 @@ function Player() { this.supportsOverlay = false; - this.muted = false; } Player.prototype.init = function(elemID) { //make overlay settings happy..., add a dummy element @@ -11,7 +10,6 @@ Player.prototype.pause = function() { } Player.prototype.get = function() { } Player.prototype.listener = function() { } Player.prototype.set = function(pos) { } -Player.prototype.mute = function(pos) { } Player.prototype.volUp = function() { } Player.prototype.volDown = function() { } Player.prototype.seekFwd = function(ms) { @@ -26,15 +24,6 @@ Player.prototype.seekBack = function(ms) { 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() { this.supportsOverlay = true; @@ -63,23 +52,6 @@ VideoPlayer.prototype.volDown = function() { } 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; } @@ -101,16 +73,6 @@ VideoPlayer.prototype.pause = function() { 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() { if (Video.isPlaying == true) { Video.pause(); @@ -120,11 +82,7 @@ VideoPlayer.prototype.togglePause = function() { } VideoPlayer.prototype.listener = function() { - var t = Video.get(); - var npt = Ox.formatDuration(t, 3); - $('#timeCode').html(npt); - var seekBarPos = parseInt((t/Video.duration) * 320); - $('#seekPointer').css("left", seekBarPos + "px"); + $('#timeCode').html(Ox.formatDuration(Video.get(), 3)); } VideoPlayer.prototype.setDuration = function(duration) {