{"id":22,"date":"2023-06-01T07:45:45","date_gmt":"2023-06-01T07:45:45","guid":{"rendered":"https:\/\/s3.brandydigital.com\/?page_id=22"},"modified":"2023-06-01T07:46:15","modified_gmt":"2023-06-01T07:46:15","slug":"video-demo-2","status":"publish","type":"page","link":"https:\/\/s3.brandydigital.com\/index.php\/video-demo-2\/","title":{"rendered":"Video demo"},"content":{"rendered":"\r\n\r\n<style>\r\n    \r\n\/* FOLLOWING TWO SHOULD HAVE SAME COLOR - videoControlBarColor *\/\r\n\/* Background color of control bar and big play button *\/\r\n#video1 .vjs-big-play-button {\r\n    border-color: #efefef  !important;\r\n    background-color: #333333 !important;\r\n    font-size: 20px !important;\r\n    opacity: .7;\r\n     }\r\n\r\n\/* Color of control bar *\/\r\n#videocontent1 .vjs-control-bar button {\r\n    background: unset !important;\r\n}    \r\n\r\n\r\n#videocontent1 .vjs-matrix .vjs-control-bar {\r\n    background: #333333 !important;\r\n    opacity: 1.0 !important;\r\n} \r\n\r\n\/* FOLLOWING TWO SHOULD HAVE SAME COLOR - videoMainColor *\/\r\n\/* Color of all text, icons and \"play\" triangle *\/\r\n#videocontent1 .vjs-default-skin {\r\n    color: #efefef !important; \r\n    overflow: hidden !important;\r\n            font-size: 10px !important;\r\n    }\r\n    \r\n\/* Change the color of various \"bars\" text: Scrubber and Volume - make it same as bg color of big play button*\/\r\n#videocontent1 .vjs-matrix .vjs-volume-level,\r\n#videocontent1 .vjs-matrix .vjs-play-progress,\r\n#videocontent1 .vjs-matrix .vjs-slider-bar\r\n{\r\n    background: #efefef !important;\r\n}\r\n    \r\ndiv#videocontent1 {\r\n    display: block !important;\r\n}    \r\n\r\n    \r\n                    \r\n\r\n\r\n\/* Style inner div to center button *\/\r\n.inner {\r\n    left: 50%;\r\n    top: 10%;\r\n    transform: translate(-50%, -50%);\r\n    position: absolute;\r\n}    \r\n    \r\n    \r\n\r\n        \/* hide the captions settings item from the captions menu *\/\r\n        .video1.vjs-texttrack-settings {\r\n          display: none;\r\n        }\r\n        \r\n    \r\n    #videocontent1 .vjs-menu-button-popup .vjs-menu .vjs-menu-content {\r\n        background-color: #333333 !important;\r\n        color: #efefef !important;\r\n        padding: 0px !important;\r\n        margin: 0px !important;\r\n        max-height: none !important;\r\n    }\r\n    \r\n    #videocontent1 .vjs-menu-content li {\r\n        list-style: none !important;\r\n    }\r\n    \r\n    #videocontent1 li.vjs-menu-item {\r\n        margin-bottom: 0px !important;\r\n        margin: 0px !important;\r\n    }\r\n    \r\n    #videocontent1 .vjs-control .vjs-button {\r\n        padding-left: 0px !important;\r\n        padding-right: 0px !important;\r\n        margin-left: 0px !important;\r\n        padding:0px !important;\r\n    }\r\n    \r\n    #videocontent1 .vjs-playback-rate-value {\r\n        margin-right: 0em;\r\n    }\r\n    \r\n    #videocontent1 .vjs-playback-rate {\r\n        margin-right: 0em;\r\n    }\r\n        \r\n\r\n    \r\n#videocontent1 .vjs-user-inactive .vjs-control-bar {\r\n    display: none !important;\r\n    visibility: hidden !important;\r\n    opacity: 0 !important;\r\n    cursor: none !important;\r\n}\r\n    \r\n\/**\r\n#videocontent1 .vjs-big-play-button {\r\n    border: 0px !important;\r\n}\r\n*\/\r\n    \r\n#videocontent1 .vjs-play-control {\r\n    border: 0px !important;\r\n}\r\n    \r\n#videocontent1 .vjs-mute-control {\r\n    border: 0px !important;\r\n}\r\n\r\n#videocontent1 .vjs-control {\r\n    border: 0px !important;\r\n}\r\n\r\n#videocontent1 .vjs-button {\r\n    padding: 0px !important;\r\n    border: 0px !important;\r\n}    \r\n    \r\n#videocontent1 .vjs-picture-in-picture-control {\r\n    display: none !important;\r\n    visibility: hidden !important;\r\n    opacity: 0 !important;\r\n    cursor: none !important;\r\n}\r\n    \r\n    \r\n\r\n.video-js-dimensions.vjs-fluid { \r\n    padding-top: 56.25%;\r\n }\r\n.video-js { padding-top: 56.25%; }\r\n    \r\n    \r\n    \r\n<\/style>\r\n\r\n<script>\r\n\r\n    var watermarkCounter = 1;\r\n\r\n<\/script>\r\n\r\n\r\n        <!-- Streaming Video -->\r\n        <link href=\"https:\/\/s3.brandydigital.com\/wp-content\/plugins\/S3MediaVaultPro\/includes\/css\/videojs.watermark.css\" rel=\"stylesheet\">\r\n        <link href=\"https:\/\/s3.brandydigital.com\/wp-content\/plugins\/S3MediaVaultPro\/includes\/css\/videojs-http-source-selector.css\" rel=\"stylesheet\">\r\n        \r\n        <script src=\"https:\/\/s3.brandydigital.com\/wp-content\/plugins\/S3MediaVaultPro\/includes\/javascript\/videojs.watermark.js\"><\/script>\r\n        \r\n        <!-- <script src=\"https:\/\/s3.brandydigital.com\/wp-content\/plugins\/S3MediaVaultPro\/includes\/javascript\/videojs-http-streaming.min.js\"><\/script> -->\r\n                <script src=\"https:\/\/s3.brandydigital.com\/wp-content\/plugins\/S3MediaVaultPro\/includes\/javascript\/videojs-contrib-quality-levels.js\"><\/script>\r\n        <script src=\"https:\/\/s3.brandydigital.com\/wp-content\/plugins\/S3MediaVaultPro\/includes\/javascript\/videojs-http-source-selector.js\"><\/script>\r\n\r\n                    <div id=\"videocontent1\" class=\"video-wrap\">\r\n                                <video N id=\"video1\"  playsinline oncontextmenu=\"return false;\" class=\"vjs-matrix video-js-responsive-container video-js  vjs-16-9  vjs-default-skin vjs-big-play-centered\"  controls  crossorigin=\"anonymous\" preload=\"auto\"  width=\"800\" height=\"450\"   type='application\/x-mpegURL' data-setup='{\"fluid\": true  ,\"playbackRates\": [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]  }'>\r\n                    <source src=\"https:\/\/dje3h489psnzp.cloudfront.net\/streaming\/VIDEO-2023-04-01-12-35-34.m3u8?Expires=1779863062&Signature=ZaUeDP6rvsXSLE9RYRddNEMs2zuOGp9Tcrjr3A9GMmmfalATrgTt92BdjBVXxNMT1oxrDO07EMz81c~haFFSViNsmKUTmuZim27pDvfgo4zZZJeWoRiLEgxodx507zAs6dQH0EQeIlCgP3N46JD7fZAX3Pc~Xlh73Dvdoompjuy3F~0SyJFNy07LmyL5eMWb0wNjquJPcAfCoPYdZnOqk9rxKda4P8-V6sShaOGkHWPlaFaTng7UT3Oy28cNfiMp0M2QoJdCOjUxZWzRQDBBnxpQd-LL0mS1nbpCcbzdUtDB1MKb91UFNIJNBvzJjBbS9c72zkCPSRsSfi2A9b0uDg__&Key-Pair-Id=APKA6MV6YTPXKZZSRGT4\">\r\n                                    <\/video>\r\n                    \r\n             <\/div>\r\n\r\n            \r\n        \r\n        \r\n        <script>\r\n            videojs.options.hls.overrideNative = true;\r\n            videojs.options.html5.nativeAudioTracks = false;\r\n            videojs.options.html5.nativeTextTracks = false;\r\n            videojs.options.enableLowInitialPlaylist = true;\r\n            \r\n            \r\n            var player1 = videojs('video1', {\r\n                html5: {\r\n                    nativeAudioTracks: false,\r\n                    nativeVideoTracks: false,\r\n                    nativeTextTracks: false,\r\n                    hls: {\r\n                        overrideNative: true\r\n                    },\r\n                                controlBar: {\r\n                        captionsButton: false\r\n                    },\r\n                                    \r\n                                plugins: {\r\n                        httpSourceSelector:\r\n                        {\r\n                            default: 'auto'\r\n                        }\r\n                    }\r\n                                \r\n                }\r\n                \r\n                            \r\n            });\r\n                        \r\n                player1.httpSourceSelector();\r\n            \r\n                        \r\n        <\/script>\r\n\r\n\r\n        <style>\r\n    \r\n    .vjs-fullscreen { padding-top: 0px }\r\n\r\n        \r\n    .buttonClass {\r\n        display: flex;\r\n        justify-content: center;\r\n        align-items: center;\r\n        vertical-align: baseline;\r\n        padding: 0px;\r\n    }\r\n\r\n                div1.vjs-watermark {\r\n                bottom: 30px !important;\r\n                top: unset !important;\r\n                right: 0 !important;\r\n                left: unset !important;\r\n            }\r\n         \r\n<\/style>\r\n<script>\r\n    \r\n\/* <![CDATA[ *\/\r\nvar threshold1;\r\nvar ajaxurl = \"https:\/\/s3.brandydigital.com\/wp-admin\/admin-ajax.php\";\r\nvar promise;\r\n\r\nvar player1 = videojs('video1',{\r\n  width: \"800\",\r\n  height: \"450\"\r\n});\r\n    \r\nvar div1;\r\n\r\n\r\n\r\nvar hasBeenClosed = false;\r\n       \r\n        function closePIP() {\r\n            var $videoWrap = jQuery('.video-wrap');\r\n            var $video = jQuery('.video');\r\n            var $closeButton = jQuery('.closeButton')\r\n\r\n            $videoWrap.height('auto');\r\n            $video.removeClass('stuck');\r\n            $closeButton.removeClass('closeShowing');\r\n            $closeButton.addClass('closeHidden');\r\n\r\n            hasBeenClosed = true;\r\n            player1.pause();\r\n            videojs('video1', { inactivityTimeout: 0 });\r\n            player1.bigPlayButton.show();\r\n\r\n        }\r\n    \r\njQuery(document).ready(function($) {\r\n    \r\n    jQuery(\"#closeButton\").hide();\r\n    var $window = jQuery(window);\r\n    var $videoWrap = jQuery('.video-wrap');\r\n    var $video = jQuery('.video');\r\n    var videoHeight = $video.outerHeight();\r\n    var $closeButton = jQuery('.closeButton')\r\n\r\n    $window.on('scroll',  function() {\r\n        var windowScrollTop = $window.scrollTop();\r\n        var videoBottom = videoHeight + $videoWrap.offset().top;\r\n\r\n        if ( (windowScrollTop > videoBottom) && !hasBeenClosed ) {\r\n            $videoWrap.height(videoHeight);\r\n            $video.addClass('stuck');\r\n            \/\/$closeButton.removeClass('closeHidden');\r\n            \/\/$closeButton.removeClass('closeHidden');\r\n            \/\/$closeButton.addClass('closeShowing');\r\n            \/\/$closeButton.display('block');                            \r\n            jQuery(\"#closeButton\").show();\r\n        } else {\r\n            $videoWrap.height('auto');\r\n            $video.removeClass('stuck');\r\n            jQuery(\"#closeButton\").hide();\r\n        }\r\n\r\n        \/\/console.log(\"videoHeight: \" + videoHeight + \", windowScrollTop: \" + windowScrollTop + \", videoBottom: \" + videoBottom);\r\n\r\n    });\r\n\r\n\/\/hideWatermarkOnLoad1();\r\n    \/\/alert(jQuery(window).width() + \", \" + jQuery(window).height());\r\n    div = document.getElementsByClassName(\"vjs-watermark\")[1-1];\r\n    if (div) {\r\n        \/\/div.style.display = \"none\";\r\n    }\r\n\r\n        \r\n        if(jQuery(window).width() >= 500) {\r\n            var skipBehindButton1 = player1.controlBar.addChild(\"button\", {}, 2);\r\n            var skipBehindButtonDom1 = skipBehindButton1.el();\r\n            skipBehindButtonDom1.innerHTML = \"<<\";\r\n            skipBehindButtonDom1.title = \"Rewind 15 Seconds\";\r\n            skipBehindButton1.addClass(\"buttonClass\");\r\n            skipBehindButtonDom1.onclick = function(){\r\n                skipS3MV1(-15);\r\n            }  \r\n\r\n            var skipAheadButton1 = player1.controlBar.addChild(\"button\", {}, 3);\r\n            var skipAheadButtonDom1 = skipAheadButton1.el();\r\n            skipAheadButtonDom1.innerHTML = \">>\";\r\n            skipAheadButtonDom1.title = \"Fast-Forward 15 Seconds\";\r\n            skipAheadButton1.addClass(\"buttonClass\");\r\n            skipAheadButtonDom1.onclick = function() {\r\n                skipS3MV1(15);\r\n            }  \r\n        }\r\n    \r\n        \r\n});\r\n    \r\n\r\nfunction skipS3MV1(skipBy) {\r\n    player1.currentTime(player1.currentTime() + skipBy);\r\n}\r\n\r\n\r\nfunction getDomainName(hostName) {\r\n    return hostName.substring(hostName.lastIndexOf(\".\", hostName.lastIndexOf(\".\") - 1) + 1);\r\n}\r\n\r\n    \r\n    function unmuteAndPlayFromStart2() {\r\n        var player1;\r\n        if(player1 == null) {\r\n            player1 = videojs(\"video1\");\r\n        }\r\n        \r\n        if( (player1.muted()) && (timesMuted == 1) ) {\r\n            player1.watermark({\r\n              file: '',\r\n              xpos: 1,\r\n              ypos: 0,\r\n              xrepeat: 0,\r\n              opacity: 0,\r\n              url: '',\r\n              clickable: false,\r\n              text: false,\r\n              textContent: '',\r\n              fontSize: 0,\r\n              fontColor: '',\r\n              fontBGColor: ''\r\n            });    \r\n            \r\n                        player1.currentTime(0);\r\n            player1.muted(false);\r\n            player1.play();\r\n        }\r\n        timesMuted++;\r\n    }\r\n\r\n    \r\n    function unmuteAndPlayFromStart1(player1) {\r\n        \/\/var player1;\r\n        if(player1 == null) {\r\n            player1 = videojs(\"video1\");\r\n        }\r\n        \/\/alert(timesMuted);\r\n                player1.currentTime(0);\r\n        player1.muted(false);\r\n        player1.play();\r\n    }\r\n\r\n    \r\nfunction roundUpToAny(n,x=15) {\r\n    return Math.round((n+x\/2)\/x)*x;\r\n}\r\n            \r\n    \r\nvideojs(\"video1\").ready(function() {\r\n    \r\n\tvar player1 = videojs(\"video1\");\r\n    timesMuted = 0;\r\n    var button = document.createElement(\"button\");\r\n    button.setAttribute(\"id\", \"muteButton\");\r\n    var buttonRemoved = false;\r\n    var endTime = 0;\r\n    \r\n    this.on('volumechange', function(){\r\n        timesMuted++;\r\n        \/\/alert(\"volume change \" + timesMuted);\r\n        if( !buttonRemoved && (timesMuted == 2) ) {\r\n            \/\/alert(\"inside\");\r\n            unmuteAndPlayFromStart1(player1);\r\n            video1.removeChild(button);\r\n            \/\/document.getElementById(\"muteButton\").remove();\r\n            buttonRemoved = true;\r\n        }        \r\n    });\r\n    \r\n        \r\n    \r\n\r\n    \r\n    this.on('click', function(evt) {\r\n        \/\/alert(\"video clicked, \" + evt.target.tagName);\r\n        if (evt.target.tagName === 'VIDEO') {\r\n            \/\/alert(\"after click unmuteAndPlayFromStart1(player1)\");\r\n            \/\/document.getElementsByTagName.removeChild(button);\r\n            if(!buttonRemoved) {\r\n                if(document.getElementById(\"muteButton\")) {\r\n                    document.getElementById(\"muteButton\").remove();\r\n                    buttonRemoved = true;\r\n                    unmuteAndPlayFromStart1(player1);\r\n                }\r\n            }\r\n        }\r\n    });\r\n    \r\n    this.on('pause', function() {\r\n        div = document.getElementsByClassName(\"vjs-watermark\")[1-1];\r\n        if (div) {\r\n            div.style.display = \"none\";\r\n        }\r\n        jQuery('#video1 .vjs-big-play-button').css('display', 'block');\r\n    });\r\n    \r\n        \r\n\tvar threshold1 = 15;\r\n\tvar counter1 = threshold1;\r\n    var duration1 = 0;\r\n    \r\n    \/\/console.log(\"ping 1: start firing\");\r\n    \/\/Track loading time\r\n\tvar data = {\r\n\t\t'action': 'trackLoads',\r\n\t\t'videoId': 1,\r\n\t\t'playTime': 0,\r\n        'event': 'load',\r\n        'postId': 22\t};\r\n    \r\n\tjQuery.post(ajaxurl, data, function(response) { });\r\n    \r\n    st1 = -1;\r\n    et1 = 99999;\r\n    \/\/alert(\"st1: \" + st1 + \", et1: \" + et1);\r\n    playTime1 = 0;\r\n    playTimeCurrent1 = 0;\r\n    \r\n    \/\/console.log(\"playTime1: \" + playTime1);\r\n    \/\/console.log(\"playTimeCurrent1: \" + playTimeCurrent1);\r\n    \r\n    \/\/console.log(parseInt(st1));\r\n    if(parseInt(st1) >= 0 ) {\r\n        playTimeCurrent1 = parseInt(st1);\r\n    }\r\n    this.currentTime(playTimeCurrent1);\r\n    if( (this.currentTime() + threshold1) > counter1 ) {\r\n        \/\/console.log(\"this.currentTime: \" + this.currentTime() + \", counter1: \" + counter1);\r\n        counter1 = this.currentTime() + threshold1;\r\n        \/\/console.log(\"new this.currentTime: \" + this.currentTime() + \", counter1: \" + counter1);\r\n    }\r\n    \/\/console.log(\"playTime: \" + playTime);\r\n\tvar gotDuration1 = false;\r\n    \r\n    player1.ready(function(){\r\n        this.on('loadedmetadata', function(){ \r\n            \/\/console.log(\"this.duration: \" + this.duration());\r\n            duration1 = this.duration();\r\n            \/\/if (this.currentTime() <= duration1 -1)\r\n        })\r\n    });\r\n\r\n    this.on(\"seeked\", function(){\r\n        \/\/console.log(\"seeked: ------------------------Seeking\");\r\n        cuepoint = 0;\r\n        \r\n                \r\n        \r\n        ct = this.currentTime();\r\n        roundUp = roundUpToAny(ct,15);\r\n        \/\/diff = roundUp - counter1;\r\n        diff = ct - playTimeCurrent1;\r\n        diffRoundup = roundUpToAny(diff,15) - 30;\r\n        \/\/playTime1 = diffRoundup;\r\n        \/\/console.log(\"playTimeCurrent1: \" + playTimeCurrent1 + \", ct: \" + ct + \", roundUp: \" + roundUp + \", diff: \" + diff + \", diffRoundup: \" + diffRoundup);\r\n        \/\/console.log(\"seeked: currentTime \" + ct + \", old counter1: \" + counter1 + \", roundUp: \" + roundUp + \", diff: \" + diff);\r\n        counter1 = roundUp;\r\n        \/\/console.log(\"New counter1: \" + counter1);\r\n        \r\n        if( (diffRoundup > 15) || (diffRoundup < -15) ) {\r\n            \/\/console.log(\"seeked: Yes, diff > 15 or < -15: \" + diffRoundup);\r\n            \/\/console.log(\"ping 2: seeked\");\r\n            var data = {\r\n                'action': 'trackViews',\r\n                'playTime': this.currentTime(),\r\n                'videoId': 1,\r\n                'duration': this.duration(),\r\n                'threshold': threshold1,\r\n                'event': 'seek',\r\n                'diff': diffRoundup,\r\n                'postId': 22            };\r\n            jQuery.post(ajaxurl, data, function(response) { });\r\n        }\r\n        \r\n        playTimeCurrent1 = this.currentTime();\r\n        \/\/console.log(\"playTimeCurrent1: \" + playTimeCurrent1);\r\n\r\n        \/\/if(ct > roundUp) {\r\n            \/\/console.log(\"DO SOMETHING IMPORTANT HERE!!!!!!!!\");\r\n        \/\/}\r\n    });\r\n    \r\n    this.on(\"timeupdate\", function(){\r\n        \/\/console.log(\"in timeupdate\");\r\n        if (this.currentTime() >= et1) {\r\n            this.pause();\r\n        }\r\n        \r\n        \/\/if( (this.currentTime() + threshold1) > counter1 ) {\r\n            \/\/counter1 = this.currentTime() + threshold1;\r\n            \/\/console.log(\"this.currentTime: \" + this.currentTime() + \", counter1: \" + counter1);\r\n        \/\/}\r\n        \r\n        \/**\r\n        if (this.currentTime() <= duration1 -1) {\r\n            \/\/alert(\"here\");\r\n            playTime1 = 0;\r\n            playTimeCurrent1 = 0;\r\n        } else {\r\n            playTime1 = this.currentTime();\r\n            playTimeCurrent1 = this.currentTime();\r\n        }\r\n        \r\n        if( (this.currentTime() + threshold1) < counter1 ) {\r\n            console.log(\"this.currentTime: \" + this.currentTime() + \", counter1: \" + counter1);\r\n            counter1 = this.currentTime() + threshold1;\r\n            console.log(\"new this.currentTime: \" + this.currentTime() + \", counter1: \" + counter1);\r\n        }\r\n        *\/\r\n\t\t\r\n        \/\/console.log(\"timeupdate: ---> this.currentTime: \" + this.currentTime() + \", counter1: \" + counter1);\r\n        \r\n        if (this.currentTime() >= counter1) {\r\n            \/\/console.log(\"timeupdate: currentTime() >= counter1\");\r\n\r\n\t\t\t\/\/set a timer for threshold seconds\r\n            \/\/console.log(\"this.currentTime: \" + this.currentTime() + \", counter1: \" + counter1 + \", threshold1: \" + threshold1);\r\n\t\t\tsetInterval(function() {\r\n\t\t\t\t\/\/do nothing\r\n\t\t\t}, threshold1 * 1000);\r\n\t\t\t\/\/alert (counter1 + \" seconds up\");\r\n\t\t\t\r\n\t\t\tcounter1 += threshold1;\r\n\r\n\t\t\tif(!gotDuration1) {\r\n\t\t\t\tduration1 = this.duration();\r\n\t\t\t\tgotDuration1 = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\/\/Track play time\r\n            if( !this.paused() ) {\r\n                \/\/console.log(\"ping 3: timeupdate\");\r\n                var data = {\r\n                    'action': 'trackViews',\r\n                    'playTime': this.currentTime(),\r\n                    'videoId': 1,\r\n                    'duration': this.duration(),\r\n                    'threshold': threshold1,\r\n                    'event': 'play',\r\n                    'postId': 22                };\r\n                jQuery.post(ajaxurl, data, function(response) { });\r\n            }\r\n\r\n\t\t}\r\n        \r\n\t});\r\n\t\r\n    this.on(\"play\", function(){\r\n        \/**\r\n        if(this.currentTime() < playTimeCurrent1) {\r\n            console.log(\"play: this.currentTime() < playTimeCurrent1\");\r\n            if(this.currentTime() < this.duration()) {\r\n                this.currentTime(playTimeCurrent1);\r\n            } else {\r\n                this.currentTime(0);\r\n            }\r\n            \/\/alert(this.currentTime() + \", \" + playTime);\r\n        }\r\n        *\/\r\n        \r\n                \r\n        var data = {\r\n            'action': 'trackLoads',\r\n            'videoId': 1,\r\n            'playTime': 0,\r\n            'event': 'start',\r\n            'postId': 22        };\r\n    \r\n\t    jQuery.post(ajaxurl, data, function(response) { });        \r\n        \r\n        jQuery('#video1 .vjs-big-play-button').css('display', 'none');\r\n        \r\n                    div = document.getElementsByClassName(\"vjs-watermark\")[1-1];\r\n            if (div) {\r\n                div.style.display = \"block\";\r\n            }\r\n                    });\r\n\r\n    \r\n    this.on(\"fullscreenchange\", function(){\r\n\t\tjQuery('.vjs-loading-spinner').remove();\r\n\t\tthis.loadingSpinner.hide();\r\n\t});\r\n\t\r\n    this.on('ended', function() {\r\n        \/\/console.log(\"ping 4: ended\");\r\n        var data = {\r\n\t\t\t'action': 'trackViews',\r\n\t\t\t'playTime': this.currentTime(),\r\n\t\t\t'videoId': 1,\r\n            'duration': this.duration(),\r\n            'threshold': threshold1,\r\n            'event': 'end',\r\n            'postId': 22\t\t};\r\n        \/\/this.currentTime(st);\r\n        \/\/alert(\"starting time: \" + st);\r\n\t\tjQuery.post(ajaxurl, data, function(response) { });\r\n        \/\/console.log('ended: ' + this.duration());\r\n        \r\n        endTime1 = this.currentTime();\r\n\t\t\/\/Track play time\r\n\t\t\/\/console.log(\"event: end firing\");\r\n        counter1 = st1;\r\n        playTime1 = 0;\r\n        playTimeCurrent1 = 0;\r\n        this.currentTime(0);\r\n        threshold1 = 15;\r\n        \/\/console.log(\"ended: ping 2\");\r\n        \r\n  \t});    \r\n    \r\n        \r\n        \r\n    \r\n    \r\n    jQuery.fn.isInViewport = function() {\r\n        var elementTop = jQuery(this).offset().top;\r\n        var elementBottom = elementTop + jQuery(this).outerHeight();\r\n\r\n        var viewportTop = jQuery(window).scrollTop();\r\n        var viewportBottom = viewportTop + jQuery(window).height();\r\n\r\n        return elementBottom > viewportTop && elementTop < viewportBottom;\r\n    };\r\n\r\n});\r\n\r\nvar promise;\r\n        \r\n\r\n\r\n\/* ]]> *\/\r\n<\/script>\r\n\r\n\r\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-22","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/s3.brandydigital.com\/index.php\/wp-json\/wp\/v2\/pages\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/s3.brandydigital.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/s3.brandydigital.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/s3.brandydigital.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/s3.brandydigital.com\/index.php\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":4,"href":"https:\/\/s3.brandydigital.com\/index.php\/wp-json\/wp\/v2\/pages\/22\/revisions"}],"predecessor-version":[{"id":26,"href":"https:\/\/s3.brandydigital.com\/index.php\/wp-json\/wp\/v2\/pages\/22\/revisions\/26"}],"wp:attachment":[{"href":"https:\/\/s3.brandydigital.com\/index.php\/wp-json\/wp\/v2\/media?parent=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}