diff --git a/infoscreen/admin.py b/infoscreen/admin.py
index ac777b3..65f2749 100644
--- a/infoscreen/admin.py
+++ b/infoscreen/admin.py
@@ -1,6 +1,7 @@
from django.contrib import admin
from infoscreen.models import Rotation, InfoItem, InfoInstance, ImageInfoItem, ExternalImageInfoItem, ABBInfoItem
from infoscreen.models import ExternalWebsiteInfoItem
+from infoscreen.models import VideoInfoItem
# Register your models here.
admin.site.register(Rotation)
@@ -9,4 +10,5 @@ admin.site.register(ImageInfoItem)
admin.site.register(ExternalImageInfoItem)
admin.site.register(ABBInfoItem)
admin.site.register(InfoInstance)
-admin.site.register(ExternalWebsiteInfoItem)
\ No newline at end of file
+admin.site.register(ExternalWebsiteInfoItem)
+admin.site.register(VideoInfoItem)
\ No newline at end of file
diff --git a/infoscreen/migrations/0004_videoinfoitem.py b/infoscreen/migrations/0004_videoinfoitem.py
new file mode 100644
index 0000000..fe2f99e
--- /dev/null
+++ b/infoscreen/migrations/0004_videoinfoitem.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9 on 2017-05-10 16:54
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('infoscreen', '0003_auto_20170329_1857'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='VideoInfoItem',
+ fields=[
+ ('infoitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='infoscreen.InfoItem')),
+ ('video', models.FileField(upload_to='infovideos/')),
+ ],
+ bases=('infoscreen.infoitem',),
+ ),
+ ]
diff --git a/infoscreen/models.py b/infoscreen/models.py
index 04859f6..c1be742 100644
--- a/infoscreen/models.py
+++ b/infoscreen/models.py
@@ -175,6 +175,21 @@ class ImageInfoItem(InfoItem):
d["options"] = {'img': self.img.url}
return d
+class VideoInfoItem(InfoItem):
+ display_name = ("Video")
+ video = models.FileField(upload_to="infovideos/")
+
+ def get_template_url(self):
+ return "/static/html/generic_video.html?video={}".format(self.name)
+
+ @staticmethod
+ def get_create_template_url():
+ return "/static/html/generic_video_create.html"
+
+ def get_dict(self):
+ d = super().get_dict()
+ d["options"] = {'video': self.video.url}
+ return d
class HslInfoItem(InfoItem):
display_name = _("HSL timetables")
@@ -298,6 +313,11 @@ class ImageUploadForm(forms.Form):
name = forms.CharField()
image = forms.ImageField()
+class UploadFileForm(forms.Form):
+
+ name = forms.CharField()
+ video = forms.FileField()
+
class HSLDataModel(models.Model):
data = models.TextField(default="", editable=False)
diff --git a/infoscreen/static/css/video.css b/infoscreen/static/css/video.css
new file mode 100644
index 0000000..ddf6269
--- /dev/null
+++ b/infoscreen/static/css/video.css
@@ -0,0 +1,17 @@
+.fullscreen-bg {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ overflow: hidden;
+ z-index: -100;
+}
+
+.fullscreen-bg__video {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/infoscreen/static/html/generic_video.html b/infoscreen/static/html/generic_video.html
new file mode 100644
index 0000000..e0274af
--- /dev/null
+++ b/infoscreen/static/html/generic_video.html
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/infoscreen/static/html/generic_video_create.html b/infoscreen/static/html/generic_video_create.html
new file mode 100644
index 0000000..c6b0ef6
--- /dev/null
+++ b/infoscreen/static/html/generic_video_create.html
@@ -0,0 +1,13 @@
+
+
+ Create new video. Enter name and select video (.WebM) for upload
+