Skip to content
Snippets Groups Projects
Commit b8fdedb4 authored by Jonas Zohren's avatar Jonas Zohren
Browse files

Show video in dialog

parent 9c36560b
No related branches found
No related tags found
No related merge requests found
Pipeline #19334 passed
......@@ -56,6 +56,19 @@
"dap1question": {
"text": "Ja, schon seit längerer Zeit und auch in diesem Semester wieder.",
"addFacts": ["stefan/askedAfterDap1"],
"options": [
{
"text": "Erzählen sie mir bitte mehr",
"linksToDialog": "showDap1Video"
},
{
"text": "Interessant",
"linksToDialog": "start"
}
]
},
"showDap1Video": {
"peertubeVideoId": "56907252-8545-4bc3-89ed-a3fa2e3cf850",
"options": [
{
"text": "Interessant",
......
......@@ -7,6 +7,7 @@
const dispatch = createEventDispatcher();
export let imageUrl: string;
export let peertubeVideoId: string;
export let title: string | undefined;
export let text: string;
export let options: DialogOption[] = [];
......@@ -72,8 +73,17 @@
</h3>
{/if}
<img src={imageUrl} />
<img src={imageUrl} alt="Character you are talking to" />
{#if typeof peertubeVideoId === "string" && peertubeVideoId.length > 0}
<iframe
title="Embedded video"
height="400"
sandbox="allow-same-origin allow-scripts allow-popups"
src="https://video.oh14.de/videos/embed/{peertubeVideoId}?autoplay=1&title=0&warningTitle=0&peertubeLink=0"
frameborder="0"
allowfullscreen
/>
{/if}
<div>
<Typewriter cascade interval={10} cursor={false}>
{#each text.split("\n") as para}
......
......@@ -18,6 +18,10 @@
},
"type": "array"
},
"peertubeVideoId": {
"description": "Embeds a peerTube-Video into this dialog and plays it when the dialog is opened.",
"type": "string"
},
"imageUrl": {
"description": "Can be used to overwrite imageUrl from DialogSet.\nE.g. when a different emotion should be shown for this dialog,",
"type": "string"
......
......@@ -45,6 +45,11 @@ export interface Dialog {
* E.g. when a different emotion should be shown for this dialog,
*/
imageUrl?: string;
/**
* Embeds a peerTube-Video into this dialog and plays it.
*/
peertubeVideoId?: string;
/**
* What the characters says to the player.
* Line breaks (\n) are rendered as paragraphs.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment