GithubHelp home page GithubHelp logo

interactivevideos's Introduction

interactiveVideo

Introduction

This is a small app that plays video's and displays questions. The questions should stop the video, and be displayed on a specific time. These times are set in the question object, in the video object the relation is made with a certain question.

Back-End

To communicate with the collections in the database I've setup two models/schema's(media and question). The media schema has an array of questions in where the relation is made with the question model/schema.

The Back-End is setup with one route called media. In this route a get request is made to the database to find all media, and while doing that the question array is puppulated with the actual question objects. This in order to acces the related question's information via media.

Front-End

In the Front-End I've created three components: Allvideos, Singlevideo, and Playvideo. I've chosen for this setup to let the data flow downwards from the Allvideos to Singlevideo to Playvideo.

Allvideos component: Allvideos contains a get request to the API, and stores the returned media's in the state as an array. While doing that the first media in the array is set in the state as the selected video. When rendering the component loops through the array of media's to create a singlevideo component for every media. The media object is passed to the Singlevideo component as props.

Singlevideo component: The Singlevideo component contains a get request to the youtube data API to retrieve the playtime of the video. The component then renders the thumbnail and duration of the video. When the API returns with an empty array the state corruptVideo is set to true, and the component returns an empty div. This is done so no "broken" video's are shown. When clicking on an video, the videoObject is passed to the Allvideos component, and set in the state selectedVideo.

Playvideo component: The Playvideo component receives the media object, and renders the video. When the user clicks play an interval is started to check the current time of the video, with the time of the interactive questions that are in the media's array. When the time matches the time of a question, the question pops-up.

interactivevideos's People

Contributors

jaumebn avatar michielab avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.