Advertisement
Guest User

IIFE

a guest
Aug 18th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.     'use strict';  
  3.  
  4.     /**
  5.      * Useful when viewer enters a room after a video was supposed to have started.
  6.      * Need to apply Math.floor, otherwise Blink throws an error regarding non-finite numbers.
  7.      * Result is then used to set the currentTime on video player.
  8.      * @param   {float} - caseTime
  9.      * @param   {float} - currentTime
  10.      * @returns {float} - Result Diff b/t nCaseTime, which is set in the Update() method of each room, & nCurrentTime.get().
  11.      */
  12.     var nTimeDiff             = function (caseTime, currentTime) {
  13.         var floorCurrentTime    = Math.floor(currentTime);
  14.         var floorCaseTime       = Math.floor(caseTime);
  15.         var result              = floorCurrentTime - floorCaseTime;
  16.  
  17.         return result;
  18.     };
  19.  
  20.  
  21.   // DOES NOT SHOW PARAMS OR COMMENTS
  22.   nTimeDiff(timeOne, timeTwo);
  23.  
  24. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement