Skip to content
Snippets Groups Projects
Commit bc644317 authored by Julian Rother's avatar Julian Rother
Browse files

Merge branch 'master' of git.fsmpi.rwth-aachen.de:videoagwebsite/videoagwebsite

parents f841a3a6 44bf5794
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ DB_DATA = 'db_example.sql'
#DB_ENGINE = 'mysql'
#MYSQL_HOST = 'localhost'
#MYSQL_USER = 'videoag'
#MYSQL_PORT = 3306
#MYSQL_PASSWD = 'somuchsecret'
#MYSQL_DB = 'videos'
......
......@@ -47,7 +47,7 @@ elif config['DB_ENGINE'] == 'mysql':
def get_dbcursor():
if 'db' not in g or not g.db.is_connected():
g.db = mysql.connector.connect(user=config['MYSQL_USER'], password=config['MYSQL_PASSWD'], host=config['MYSQL_HOST'], database=config['MYSQL_DB'])
g.db = mysql.connector.connect(user=config['MYSQL_USER'], password=config['MYSQL_PASSWD'], host=config['MYSQL_HOST'], port=config['MYSQL_PORT'], database=config['MYSQL_DB'])
if not hasattr(request, 'db'):
request.db = g.db.cursor()
return request.db
......
......@@ -629,6 +629,22 @@ def sitemap():
return Response(render_template('sitemap.xml', pages=pages), 200, {'Content-Type': 'application/atom+xml'} )
@app.route('/site/')
@app.route('/site/<string:phpfile>')
def legacy(phpfile=None):
if phpfile=='embed.php' and ('lecture' in request.args):
return redirect(url_for('embed', id=request.args['lecture']),code=302)
if phpfile=='feed.php' and ('all' in request.args):
return redirect(url_for('feed'),code=302)
if phpfile=='feed.php' and ('newcourses' in request.args):
return redirect(url_for('courses_feed'),code=302)
if phpfile=='feed.php':
return redirect(url_for('feed', handle=request.args.copy().popitem()[0]),code=302)
print("Unknown legacy url:",request.url)
return redirect(url_for('index'),code=302)
import feeds
import importer
import stats
......
......@@ -131,7 +131,7 @@
<div class="container-fluid">
<ul class="list-inline" style="margin-top: 5px;">
<li>
<a href="http://www.fsmpi.rwth-aachen.de/">Fachschaft I/1</a>
<a href="https://www.fsmpi.rwth-aachen.de/">Fachschaft I/1</a>
</li>
<li>
<a href="http://www.vampir.rwth-aachen.de/">Vampir e.V.</a>
......@@ -140,7 +140,7 @@
<a href="https://www.youtube.com/channel/UCxh5snRN7yZyBsytNbGNuEQ">Youtube</a>
</li>
<li>
<a href="#">Facebook</a>
<a href="https://www.facebook.com/videoag">Facebook</a>
</li>
<li>
<a href="https://twitter.com/rwthvideo">Twitter</a>
......
......@@ -55,6 +55,29 @@
$('#videoplayer').addClass("vjs-16-9");
$('#videoplayer').css("width");
$(function() {
//resume
var progress_key = "progress_{{ lecture.id }}";
var seconds_played;
if (localStorage) {
seconds_played = localStorage.getItem(progress_key);
if (!seconds_played) {
seconds_played = 0;
} else {
videojs('videoplayer').currentTime(seconds_played);
}
}
videojs("videoplayer").on("timeupdate", function() {
if (localStorage) {
var player_cur_Time = Math.round(videojs("videoplayer").currentTime());
if(Math.abs(player_cur_Time - seconds_played) >= 10) {
seconds_played = player_cur_Time;
localStorage.setItem( progress_key , seconds_played)
}
}
});
//autoplay
var playerplay = function() {
if ($('#videoplayer').data("wasnotplayed") == 1) {
videojs('videoplayer').play();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment