Skip to Content


Create each Youtube video’s data object.

JavaScript January 10, 2018


This function runs automatically, so it is not called manually. Is this incorrect?


Automatically play a video when a Bootstrap modal opens.

jQuery(document).on('', function(e){
    vidID = jQuery('iframe').attr('id');[vidID].playVideo();

Source File

Located in /assets/js/nebula.js on line 4752.

function nebulaYoutubeReady(e){
    if ( typeof videoProgress === 'undefined' ){
        var videoProgress = {};

    var id = nebula.getYoutubeID(;
    if ( id && !nebula.videos[id] ){ //If the video object doesn't use the Youtube video ID, make a new one by duplicating from the Iframe ID
        nebula.videos[id] = nebula.videos[jQuery('id')];

    nebula.videos[id].title = nebula.getYoutubeTitle(; //Use Nullish coalescing here (after ie11?)
    nebula.videos[id].duration =; //The total duration of the video. Unit: Seconds
    nebula.videos[id].current =; //The current position of the video. Units: Seconds
    nebula.videos[id].percent =; //The percent of the current position. Multiply by 100 for actual percent.


To override or disable this JavaScript function, simply redeclare it with the exact same function name.

function nebulaYoutubeReady(){
    //Write your own code here, leave it blank, or return false.