



(function() {

    loadScript('https://hml.fpg.unc.edu/jwplayer-8.8.1/JwPlayer.js', function() { return isReferenced('jwplayer.js'); });
    /* loadScript('https://hml.fpg.unc.edu/content/scripts/jquery-3.6.0.min.js', function() { return isReferenced('jquery'); });   this was a conflict with BB Prototype library and was only used for speed so redundandant */
    loadScript('https://hml.fpg.unc.edu/content/scripts/main/frontendcombined.js?v=8.5.016', function() { return isReferenced('frontendcombined.js'); });
    loadScript("https://hml.fpg.unc.edu/content/scripts/trans/Fen.js?v=8.5.016", function() { return isReferenced('Fen.js'); });

    addReactDiv();

    addLoadEvent(waitForAllLoaded);

    function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
    window.onload = func;
    } else {
    window.onload = function() {
    if (oldonload) {
    oldonload();
    }
    func();
    }
    }
    }

    function addReactDiv()
    {
    var d = document.createElement("div");
    d.setAttribute("id", "player16019React");
    var p = document.getElementById("player16019");
    var top = p.parentNode;
    if (top === document.body) {
    top.appendChild(d);
    }
    else {
    insertAfter(d, p);
    }
    }

    function insertAfter(newNode, referenceNode) {
    referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
    }

    function isReferenced(scriptName) {
    var scripts = document.getElementsByTagName('script');

    for (var i=0; i < scripts.length; i++) {
    if (scripts[i].src.indexOf(scriptName) != -1)
    return true;
    }

    return false;
    }

    function loadScript(src, isReferenced) {
    var loaded = false;

    if (isReferenced(src))
    loaded = true;

    if (!loaded) {
    var b = document.createElement('script');
    b.type = 'text/javascript';
    b.src = src;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(b, s);
    }
    }

    var timer16019 = null;
    var timerCounter16019 = 0;

    function waitForLoaded(isLoadedFunction) {

    if (!isLoadedFunction()) {

    timerCounter16019 = window.setTimeout(function() {
    timerCounter16019++;
    if (timerCounter16019 < 10) {
    waitForLoaded(isLoadedFunction);
    } else {
    var dummy_bug_in_cshtml_parsing = 0;
    window.clearTimeout( timer16019 );
    }
    }, 1000);

    return;
    }

    window.clearTimeout(timer16019);

    }

    model = {"BaseLayoutVm":{"_customizationService":{},"_liveService":{"_resolutions":["source","720p","360p","240p","160p"],"UpdatingEdgeFiles":false,"EdgeLogToBeSeen":false},"LogonUrl":"https://hml.fpg.unc.edu/Account/LogOn?returnUrl=%2F","AdminUrl":"https://hml.fpg.unc.edu/Home/Transfer/0?mobile=%MOBILE%","UploadUrl":"https://hml.fpg.unc.edu/Home/UploadWizard/0?mobile=%MOBILE%","WebScreenRecUrl":"https://hml.fpg.unc.edu/Home/WebScreenRecWizard/0?mobile=%MOBILE%","MLChoice":0,"BackendUrl":"https://hmlupload.fpg.unc.edu/","Title":"FPG Media Library","LibraryContentUrl":"https://hml.fpg.unc.edu/Home/LibraryContent/0?mobile=%MOBILE%","ShowLoginIcon":true,"HasMyAccount":false,"ShowMyAccountIcon":false,"ShowLanguageBar":true,"HasLanguageBar":false,"LoginMessage":"Not currently logged in!","HasAdminIcon":false,"MyAccountTitle":null,"HasPlaylistBottomBar":false,"HasMyPlaylistsLink":false,"ShowAutoSearch":true,"ShowMyContent":false,"ShowPreferences":false,"ShowuploadLink":false,"JwPlayerUrl":"https://hml.fpg.unc.edu/jwplayer-8.8.1/JwPlayer.js","IsGuest":"y","ShowUploadLink":false,"HasLiveLink":false,"LiveMenuText":"Live","ShowCollaaj":false,"AllowRunCollaaj":false,"MediaLectureClassroomInstaller":false,"MediaLectureInstalledForIpAndUserId":false,"LiveEditUrl":"https://hml.fpg.unc.edu/Home/EditLive/0?returnTo=livefrontend\u0026liveChannelId=","PlaylistVm":{"PlaylistItems":[],"IsPlaylistDisplayed":false,"PlaylistId":0,"PlaylistCurrentSelectionVm":{"PlaylistCurrentSelectionItems":[],"CurrentPlaylistName":""},"IsEditable":false,"Width":0,"Height":0,"Quality":"","Title":"","EnablePlaylists":false},"IsMac":false,"IsWindows":true,"Language":"en","UsOrUk":"us","IsSso":false,"SsoLoginName":"Single-Sign-On Login","LocalLoginName":"Local User Login","ShowLocalLogin":true,"ShowGDriveModal":false,"VlsHeaderPath":"https://hml.fpg.unc.edu/AppWide/Administrator/Customisation/vls/px_top.png?r=8","VlsBrandPath":"https://hml.fpg.unc.edu/Content/Images/Global/medial-logo-dark-bg.png?r=8","FooterText":"Copyright 2018 All Rights Reserved","DisplayFooterIcon":false,"MobileHeaderImagePath":null,"IphoneShortcutImagePath":null,"MenuPosition":"MIDDLE","ShowCategory":true,"WidePlayPageVideo":false,"HeaderHeight":126,"HeaderWidth":1058,"HeaderRestrictHeight":126,"HeaderRestrictWidth":1058,"HeaderFocusY":"Center","HeaderPosition":"Center","HeaderColour":"#fff","WideHeaderImage":false,"PanelColour":"","ShowHeaderImage":false,"ThemeName":"dark","Theme":{"BrandMatchColour":"#86BF3A","LinkHighlightColour":"#999999","NavBarBackgroundColour":"#414142","NavBarIconColour":"#999999","NavBarIconHoverColour":"#ffffff","BodyBackgroundColour":"#2c3037","BodyTextColour":"#dddddd","BodyTextHighlightColour":"#ffffff","BodyIconColour":"#ffffff","LogoImageName":"medial-logo-dark-bg.png","MiniLogo":"medial-icon-dark.png","PaperColour":"#e8ebf0","PenColour":"#020202","PaperIconColour":"#020202","TabBackgroundColour":"#BBBBBB","PaperIconHoverColour":"#000","BorderLines":"#888888","LightBorderLines":"#BEC1C4","NavBorderLines":"#444444","DefaultButtonBgColour":"#337ab7","DefaultButtonFgColour":"#ffffff","TitleColour":"#020202","TitleBackgroundColour":"#e8ebf0"},"HomeLinkVm":{"Links":[{"Name":"FPG Child Development","Url":"http://www.fpg.unc.edu"},{"Name":"UNC","Url":"http://unc.edu"}],"LinksTrans":"Links"},"BrandHeight":70,"BrandWidth":221,"BrandXPosition":"Left","BrandYPosition":"Center","BrandRestrictHeight":0,"HeaderType":"HeaderImage","LogoutRedirectUrl":"https://hml.fpg.unc.edu/","HostName":"hml.fpg.unc.edu","HmlVersion":"V2.5.0","ClientAnalyticsId":"UA-15400308-31","ShowGoogleAnalytics":true,"BlockForFooter":"","Nonce":"fS6cVBOvV69uC3sHH0tdxpX1xbw="},"CaptionQualityScreenVm":{"ShowLink":false,"ShowQualityLink":false,"VideoId":16019,"ShowLogon":true,"ShowEdit":false,"EditModel":null,"VerticalHeightNeeded":0},"VodPlayerModel":{"DivName":"player16019","PlayerJson":"{\"base\": \"https://hml.fpg.unc.edu/jwplayer-8.8.1/\", \"analytics\" : { \"enabled\": false }, \"autostart\": \"true\", \"width\": \"100%\", \"aspectratio\": \"16:9\", \"image\": \"https://hml.fpg.unc.edu/thumbnails/41732426.jpg?token=\u0026v=8\", \"abouttext\": \"Implementation Quick Start\", \"flashplayer\": \"https://hml.fpg.unc.edu/jwplayer-8.8.1/jwplayer.flash.swf\", \"skin\" : { \"active\": \"#A5CF55\" }, \"playbackRateControls\": \"[0.5, 0.8, 1.0, 1.2, 1.5, 2.0]\", \"sources\": [{ \"file\": \"https://helix.fpg.unc.edu/flash/smil:41732426_2.smil/playlist.m3u8\" }, { \"file\": \"https://helix.fpg.unc.edu/flash/41732426_hd.mp4/playlist.m3u8\" }, { \"file\": \"https://hml.fpg.unc.edu/flash/41732426_hd.mp4\" }, { \"file\": \"https://helix.fpg.unc.edu/flash/smil:41732426_2.smil/manifest.mpd\" }], \"tracks\": [{ \"file\": \"https://hml.fpg.unc.edu/AppWide/Content/Caption_Files/41732426.vtt?v=0\u0026token=\", \"label\": \"On\", \"kind\": \"captions\", \"default\": \"true\" },{ \"file\": \"https://hml.fpg.unc.edu/AppWide/preview/41732426_preview.vtt\", \"kind\": \"thumbnails\" }] }","StartSeconds":0,"PlayHitId":9894072,"ChapterStart":0,"ChapterEnd":0,"PlaylistNextVideoId":0,"PlaylistNextChapterId":0,"BackendUrl":"https://hmlupload.fpg.unc.edu/","FlowPlayer":false,"Token":null,"Thumbnail":"https://hml.fpg.unc.edu/thumbnails/41732426.jpg?token=\u0026v=8","HideControls":false,"Duration":353},"QuizDto":{"Name":null,"QuizId":0,"HasQuiz":false,"QuizQuestions":null,"QuizAnnotations":null,"QuizLinks":null,"WelcomeMessage":null,"LinkPictureUrl":null,"AllowSkipping":false,"UserId":0,"TimeLimitedQuestions":false,"FrontEnd":null,"DontAllowPause":false,"HideMarkers":false,"LtiFinish":false,"ReturnUrl":null,"ShowPlayMenu":false,"HasCaptions":false},"Width":0,"Height":0,"HideThumbnail":false};
var adapter;
function vodSetupDone(pl) {  } 
function readyDone(pl) {  } 
theme = model.BaseLayoutVm.Theme;
function reactSetup() {
var size = calcWindowSize();
var width = document.getElementById('player16019React').clientWidth;
var height = 0;
if (width) {
   height = width / 1.778;
   var availableHeight = size.height;
   if (model.CaptionQualityScreenVm) { availableHeight -= model.CaptionQualityScreenVm.VerticalHeightNeeded; }
   if (height > availableHeight) {height = availableHeight; width = availableHeight * 1.778 } 
}
startResizer(reactSetup);
var com = window.react.createElement(PlayScreen, __assign({ }, { "autoWidth": width, "autoHeight": height, "readyBack": readyDone, "vodSetupBack": vodSetupDone, "noCaptionsMessage": false}, model));
window.reactDOM.render(com, document.getElementById('player16019React'));  }


    function waitForAllLoaded() {
    console.log("WaitForAllLoaded");

    waitForLoaded(function () { return typeof(jwplayer) == 'function'; } );
    /*        waitForLoaded(function () { return typeof($) == 'function'; } ); */

    jwplayer.key = "SA4X6xunwFTgz9PK/Ai4Q+mOinU1/x+O3T4XCC5qD3z5qwtK";

    reactSetup();

    var e = el("player16019").innerHTML = "";

    }
    })();



