Giter Club home page Giter Club logo

adapt-youtube's Introduction

adapt-youtube

Adapt YouTube is a presentation component that allows the YouTube IFrame Player to be used within Adapt. For a fuller description of the various settings in example.json, see the YouTube IFrame Player API.

Installation

TBC

Settings Overview

The attributes listed below are used in components.json to configure Adapt YouTube Player, and are properly formatted as JSON in example.json.

Attributes

core model attributes: These are inherited by every Adapt component. Read more.

_component (string): This value must be: youtube.

_classes (string): CSS class name to be applied to YouTube containing div. The class must be predefined in one of the Less files. Separate multiple classes with a space.

_layout (string): This defines the horizontal position of the component in the block. Acceptable values are full, left or right.

instruction (string): This optional text appears above the component. It is frequently used to guide the learner’s interaction with the component.

_setCompletionOn (string): This determines when Adapt will register this component as having been completed by the user. Acceptable values are inview (triggered when the component is fully displayed within the viewport), play (triggered when playback is initiated), or ended (triggered when the video has reached the end of playback).

_media (object): The media configuration, containing values for various YouTube API features

_source (string): The URL of the YouTube video. This can be a direct link or an embed link

_controls (string): Specifies whether or not the player controls are displayed.

_allowFullscreen (string): Setting to give the learners option to play the YouTube video at full screen.

_playsinline (string): If enabled, videos will play 'inline' on iPhones (the same way they do on iPads).

_aspectRatio (string): The aspect ratio of the video as a decimal number. If the aspect ratio is 16:9 then you calculate the decimal version by dividing 16 by 9 i.e. 1.778. 4:3 aspect ratio is 1.33.

_autoplay (boolean): Specifies whether or not the video will automatically start to play when the player loads (not supported on iOS).

_showRelated (boolean): Since Sept 2018 the YouTube player no longer allows you to prevent related videos from being shown - see https://developers.google.com/youtube/player_parameters#rel

_loop (boolean): Whether to play the video on a loop or not.

_modestBranding (boolean): This parameter lets you use a YouTube player that does not show a YouTube logo. Set to true to prevent the YouTube logo from displaying in the control bar. Note that a small YouTube text label will still display in the upper-right corner of a paused video when the user's mouse pointer hovers over the player.

_playbackQuality (boolean): The suggested video quality for the video. You should select a playback quality that corresponds to the size of your video player. For example, if your page displays a 1280px by 720px video player, a hd720 quality video will actually look better than an hd1080 quality video.

_showAnnotations (boolean): Whether video annotations should be shown or not.

_progressColor (boolean): The colour that will be used in the player's video progress bar to highlight the amount of the video that the viewer has already seen. Setting this to 'white' will disable the 'modest branding' option.

_transcript (object): The transcript attributes group contains values for _inlineTranscript, _externalTranscript, inlineTranscriptButton, inlineTranscriptCloseButton, inlineTranscriptBody, transcriptLinkButton, and transcriptLink.

_setCompletionOnView (boolean): This determines if Adapt will register this component as having been completed by the user when the inline transcript is opened. This is true by default.

_inlineTranscript (boolean): Determines whether the button that toggles the display of the inline transcript text will be displayed or not.

_externalTranscript (boolean): Determines whether the button that links to the optional external transcript will be displayed or not.

inlineTranscriptButton (string): This text appears on the button that toggles the visibility of the inline transcript text. It is displayed when the inline transcript text is hidden. If no text is provided, the transcriptLink will be displayed on the button.

inlineTranscriptCloseButton (string): This text appears on the button that toggles the visibility of the inline transcript. It is displayed when the inline transcript text is visible.

inlineTranscriptBody (string): This optional text appears below the video. If provided, its visibility is toggled by clicking the transcript button. It is hidden by default.

transcriptLinkButton (string): This text appears on the button that links to the optional external transcript. If no text is provided, the transcriptLink will be displayed on the button.

transcriptLink (string): File name (including path) of the optional external transcript. Path should be relative to the src folder (e.g., course/en/pdf/video01_transcript.pdf).

Accessibility

Limitations

No known limitations


Framework versions: 5.19.1
Author / maintainer: Adapt Core Team with contributors

adapt-youtube's People

Contributors

chris-steele avatar eleanor-heath avatar guywillis avatar joe-allen-89 avatar joe-replin avatar moloko avatar oliverfoster avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adapt-youtube's Issues

properties.schema Error in uploading on Authoring Tool

Hey Matt, Happy New Year and many thanks for fixing up the youtube component. It works great in the developer framework for adapt! Just one issue I had after testing and that was on the authoring tool side of things when I upload the component I am getting an error on the properties.schema. Not sure why, here is a screenshot of the issue. Many thanks again for your help!
error-on-schema

Destructor

Need to do some clean up when component is destroyed; probably just remove player event listener(s).

properties.schema - Source Url Input field is not displaying in authoring tool

Hey Matt
Sorry to bug you once again. I Found another issue with the properties.schema. The Source Url Input field is not displaying in authoring tool. Therefore the course is erroring out on preview as it thinks there is no youtube url and I can't input the youtube url location into the component. Here is an image to help explain...
youtube-error

adapt-youtube: example.json prevents page from loading

FW v5.17.1
YouTube v2.1.0

I copied the example.json into place in components.json and only updated the ids. I get no compile error when building. But the page doesn't load. No errors reported in the dev tools console.

To be clear, this is the page that is not loading; it's not an issue of the video not loading.

Since the README provides little practical information, I tried replacing _media._source with a different video's url--following the same model. Again, the page did not load.

Videos not marking complete on ended

Subject of the issue/enhancement/features

When a user watches the video to end it doesn't mark complete as per JSON set up.

Your environment

  • version (Framework): 5.25.0
  • which browser and its version: Chrome - latest
  • device(s) + operating system(s): Laptop - windows

Steps to reproduce

Embed a YouTube video from a private YT account and set up to mark as complete when ended. Watch video to end.

Expected behaviour

The video should mark complete once ended.

Actual behaviour

Component only marks complete when transcript is seen.

Screenshots (if you can)

Missing feature for fullscreen mode

Hi just notice that this component is missing the Fullscreen mode options to enable it in the properties.schema...

"_allowFullscreen": {
"type":"boolean",
"required":false,
"default": "true",
"title": "Allow Fullscreen View",
"inputType": {"type": "Boolean", "options": [true, false]},
"validators": [],
"help": "This parameter lets you use the fullscreen function on a Youtube video. When press the video will fill the screen."
},

Also updated the youtube.hbs file with...

{{#if _media._allowFullscreen}}allowfullscreen="allowfullscreen"{{/if}}></iframe>

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.