From 15fd95bb19b3411026001cb16a0bd7fe6c8368c9 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Fri, 24 Sep 2021 20:55:57 -0500 Subject: [PATCH] Add embeded Youtube videos to tutorial space --- .../UI/Spaces/Tutorial-Space/TutorialSpace.js | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Projects/Education/UI/Spaces/Tutorial-Space/TutorialSpace.js b/Projects/Education/UI/Spaces/Tutorial-Space/TutorialSpace.js index 623f63934..c171560d9 100644 --- a/Projects/Education/UI/Spaces/Tutorial-Space/TutorialSpace.js +++ b/Projects/Education/UI/Spaces/Tutorial-Space/TutorialSpace.js @@ -50,6 +50,7 @@ function newEducationTutorialSpace() { let tutorialFormDiv = document.getElementById('tutorialFormDiv') let htmlGif = document.createElement("IMG") let htmlImage = document.createElement("IMG") + //let htmlVid = document.createElement("iframe") let currentGifName let newGifName @@ -182,6 +183,7 @@ function newEducationTutorialSpace() { checkPressButton() checkGif() checkImage() + //checkVid() checkDocumentation() checkWorkspaces() checkSlider() @@ -326,6 +328,17 @@ function newEducationTutorialSpace() { } } + function checkVid() { + let tutorialGifDiv = document.getElementById('tutorialGifDiv') + if (tutorialGifDiv !== null && tutorialGifDiv !== undefined) { + tutorialGifDiv.appendChild(htmlGif) + } + + if (currentGifName === newGifName) { return } + currentGifName = newGifName + htmlVid.src = currentGifName + } + function checkDocumentation() { if (currentNode === undefined) { return } let config = JSON.parse(currentNode.config) @@ -994,7 +1007,7 @@ function newEducationTutorialSpace() { function resumeTutorial(node) { if (UI.projects.foundations.spaces.designSpace.workspace.isInitialized !== true) { return } //Testing if removing the navigationStack reset here fixes the tutorial resume issues - //navigationStack = [] + navigationStack = [] node.payload.uiObject.isPlaying = true tutorialRootNode = node currentNode = node @@ -1016,7 +1029,7 @@ function newEducationTutorialSpace() { function resumeTutorialTopic(node) { //Testing if removing the navigationStack reset here fixes the tutorial resume issues - //navigationStack = [] + navigationStack = [] currentTopicNode = node currentNode = node currentStatus = 'Playing Topic' @@ -1037,7 +1050,7 @@ function newEducationTutorialSpace() { function resumeTutorialStep(node) { //Testing if removing the navigationStack reset here fixes the tutorial resume issues - //navigationStack = [] + navigationStack = [] currentStepNode = node currentNode = node currentStatus = 'Playing Step' @@ -1432,6 +1445,13 @@ function newEducationTutorialSpace() { newGifName = text break } + case 'Youtube': { + let text = UI.projects.education.utilities.docs.getTextBasedOnLanguage(paragraph) + let src = UI.projects.education.utilities.docs.parseYoutube(text) + console.log('text', src) + html = html + '' + break + } case 'Text': { let text = UI.projects.education.utilities.docs.getTextBasedOnLanguage(paragraph) text = UI.projects.education.utilities.docs.addKeyboard(text)