From 7e4f1f5fc3c57a700bef42740d9ff48f2b437a04 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 13 May 2021 21:46:45 +0200 Subject: read name from timeline.json --- .gitignore | 3 --- pages/present.tsx | 2 +- timeline.schema.json | 23 ++++++++++++++++++++++- timeline.ts | 6 ++++++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 1890faf..ced84a7 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,3 @@ yarn-error.log* # vercel .vercel -# typescript-json-validator -timeline.validator.ts - diff --git a/pages/present.tsx b/pages/present.tsx index 1e37702..9e65e29 100644 --- a/pages/present.tsx +++ b/pages/present.tsx @@ -225,7 +225,7 @@ export default function Present() {

14:00:41

-

PWS Presentatie

+

{player.timeline?.name || '???'}

diff --git a/timeline.schema.json b/timeline.schema.json index aa12da1..c92e722 100644 --- a/timeline.schema.json +++ b/timeline.schema.json @@ -75,6 +75,19 @@ ], "type": "object" }, + "presentationSettings": { + "additionalProperties": false, + "properties": { + "controlType": { + "const": "FullScreen", + "type": "string" + } + }, + "required": [ + "controlType" + ], + "type": "object" + }, "slide": { "additionalProperties": false, "properties": { @@ -136,6 +149,12 @@ "framerate": { "type": "number" }, + "name": { + "type": "string" + }, + "settings": { + "$ref": "#/definitions/presentationSettings" + }, "slides": { "items": { "anyOf": [ @@ -159,7 +178,9 @@ "required": [ "slides", "framecount", - "framerate" + "framerate", + "name", + "settings" ], "type": "object" } diff --git a/timeline.ts b/timeline.ts index 8bb4d98..3a51ed3 100644 --- a/timeline.ts +++ b/timeline.ts @@ -19,8 +19,14 @@ export interface loopSlide extends slide { playbackType: 'PingPong' | 'Normal'; } +export interface presentationSettings { + controlType: 'FullScreen'; +} + export default interface timeline { slides: Array; framecount: number; framerate: number; + name: string; + settings: presentationSettings; } -- cgit v1.2.3