From 70b08d4b8b3956f793c650f9610cf4423b29e3e6 Mon Sep 17 00:00:00 2001 From: P2P-Next Date: Fri, 15 Apr 2011 18:18:50 +0300 Subject: [PATCH] trial-site: update --- trial-site/NextSharePC-interface.js | 35 ++++++++++++++++++- trial-site/living-lab-admin/publish_videos.py | 3 +- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/trial-site/NextSharePC-interface.js b/trial-site/NextSharePC-interface.js index 5c6f777..9db050b 100644 --- a/trial-site/NextSharePC-interface.js +++ b/trial-site/NextSharePC-interface.js @@ -4,6 +4,18 @@ updateInterval = 500; +function getURLParam( name ) +{ + name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); + var regexS = "[\\?&]"+name+"=([^&#]*)"; + var regex = new RegExp( regexS ); + var results = regex.exec( window.location.href ); + if( results == null ) + return ""; + else + return results[1]; +} + function getPluginWidth() { return 800; @@ -36,6 +48,11 @@ function updateTime(afterSlider) var tot_s = Math.floor(len / 1000 % 60); var tot_min = Math.floor((len / 1000) / 60); + if(isNaN(crt_s)) crt_s = 0; + if(isNaN(crt_min)) crt_min = 0; + if(isNaN(tot_s)) tot_s = 0; + if(isNaN(tot_min)) tot_min = 0; + $("#nsTime").html("" + pad(crt_min, 2) + ":" + pad(crt_s, 2) + " / " + pad(tot_min, 2) + ":" + pad(tot_s, 2)); } @@ -51,8 +68,19 @@ function update() timerHandle = setTimeout("update()", updateInterval); } -function displayNextSharePC(torrent) +function displayNextSharePC(torrent, html5) { + if(html5 == true) + { + document.write(''); + document.write('

'); + document.write('Play video using VLC with NextSharePC

'); + + return true; + } + if (navigator.appName == "Netscape") { document.write(''); $("nsTable").css("width", getPluginWidth()); + + document.write('

'); + document.write('Play video using HTML5 with SwarmPlayer

'); + + return true; } function onSliderStop(event, ui) diff --git a/trial-site/living-lab-admin/publish_videos.py b/trial-site/living-lab-admin/publish_videos.py index 8a35dfd..a5ed9d6 100644 --- a/trial-site/living-lab-admin/publish_videos.py +++ b/trial-site/living-lab-admin/publish_videos.py @@ -200,7 +200,6 @@ def main(): title = file.readline().strip() if not Content.encodeAlias(title) in content_aliases: - print '*' # Database operations: contentId = Content.getContentId(dbCur, category) # Add entry in cms_content table @@ -216,7 +215,7 @@ def main(): if thumbsDir != None: # Configure thumbnail images alias = content.content_alias - basename = thumbsDir + "/" + torrent.rpartition('/')[2].rpartition('_')[0] + basename = thumbsDir + torrent.rpartition('/')[2].rpartition('_')[0] ##print 'basename: ' + basename + '; alias: ' + alias os.system("./config_thumbnails.sh " + basename + " " + alias) -- 2.20.1