Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 139893

Adding a Would you like to resume to Jwplayer

$
0
0

I am stomped and I dont even know where to start.... I am needing to add a Resume feature to my player... Where if there watching a 45 min VOD video and close the window at 34:45:23 min then when they return to the page it would say " Do you wish to resume at 34:45:23 Yes or No and yes resumes and No Starts the video over... What would this process be? Any help would be great!

My Player Code setup atm

<script type="text/javascript" src="my/jwplayer.js"></script>
                <script type="text/javascript">jwplayer.key="3SYLbRo6MN53434cBDxwpZh3dl1gb0lMTUOos31M5hoAlf4=";</script>
</div>
<script type="text/javascript">
                // jwplayer.key="sXW0X4344A1MksiJ6hYVNHKJFCtOB4qTihu2B0xyTyZoMiA=";
                jwplayer.key = 'sXW0X4343A1MksiJ6hYVNHKJFCtOB4qTihu2B0xyTyZoMiA=';</script>
</head>
<body>
  <div id="wrapvideo">
    <div id='player'></div> 
  </div>
    </body>
</html>
<script src='//static.codepen.io/assets/common/stopExecutionOnTimeout-de7e2ef6bfefd24b79a3f68b414b87b8db5b08439cac3f1012092b2290c719cd.js'></script>
<script >var playerInstance = jwplayer("player");
playerInstance.setup({ skin: {
          "name": "alaska",
          "url": "myskin.css?f=77"
        },
logo: {
          "file": "",
          "position": "top-right",
          "hide": "false",
        },

                    'file': "mp4here",
                    'title': '',
                    'aspectratio': '16:9',
                    stretching: 'exactfit',
                    'bufferlength': '5',
                    'height': '406px',
                    'width': '753>px',
                    'primary': 'hls',
                    'sharing':'false',
                    'controls':'true',
                    'autostart': 'true',
                    'wmode': 'opaque',
                    'image': '',
                    'abouttext': '',
                    'aboutlink': ''
                });

playerInstance.on('error', function (evt) {
    var element = document.getElementById("wrapvideo");
    if (evt.message === "Error loading player: No playable sources found") {
        element.innerHTML = "<p<b><center><br>blahhh</br> <br>blahhh</li><li>ANY FREE OR PAID VPN SHOULD WORK</li><li>THIS IS FOR THE LIVE FEEDS ONLY SHOWS DONT NEED A VPN</li><li>NEED HELP? ASK US IN THE CHAT :)</li></b></center></p>";
    } else
    {
        element.innerHTML = "<p<b><center><br>blahhh</br> <br>blahhh</li></b></center></p>";
    }
});

playerInstance.on('setupError', function (evt) {
    var element = document.getElementById("wrapvideo");
    if (evt.message === "No suitable players found and fallback disabled") {
        element.innerHTML = "<p<b><center><brblahhh</br> <br>blahhh</li><li>ANY FREE OR PAID VPN SHOULD WORK</li><li>THIS IS FOR THE LIVE FEEDS ONLY SHOWS DONT NEED A VPN</li><li>NEED HELP? ASK US IN THE CHAT :)</li></b></center></p>";
    } else
    {
        element.innerHTML = "<p<b><center><br>blahhh :) </br><li>blahhh</li><li>THIS IS FOR THE LIVE FEEDS ONLY SHOWS DONT NEED A VPN</li><li>NEED HELP? ASK US IN THE CHAT :)</li></b></center></p>";
    }
});

</script>
<script>
var WI = new Image();
WI.src = "";

jwplayer().addButton(
                            "",
                            "napshot",
                            function() {
                              saveScreenShot("wrapvideo");
                            },
                            "capture"
                        );
function saveScreenShot(Z) {

if (B) {
//jwplayer().pause(!0);
var F = 1;
var D = document.createElement("canvas");
D.width = B.videoWidth * F;
D.height = B.videoHeight * F;
Dwidth = window.innerWidth * 0.5;
Dwidth100 = Dwidth / (D.width / 100);
Dheight = (D.height / 100) * Dwidth100;

}
D.setAttribute("style", "height:" + Dheight + "px");
var CT = D.getContext("2d");
CT.drawImage(B, 0, 0, D.width, D.height);
CT.drawImage(WI, D.width - WI.width, 0, WI.width, WI.height);
var G = document.createElement("div");
var K = (window.innerHeight - Dheight - 50) / 2 + "px";
var L = (window.innerWidth - Dwidth) / 2 + "px";
if (window.innerWidth < 450) {
L = "0px";
Dwidth = window.innerWidth
}
var C = document.createElement("div");
var E = "position: fixed;z-index: 9999999999999;width:" + Dwidth + "px; left: " + L + ";top:0;margin-top:60px";
E += ";padding-bottom:10px; background: #292929;border-radius:5px;";
E += "text-align: center;";

J.innerHTML = 'Right click to Save  Snapshot..';
    J.setAttribute("style", "margin: 10px;display: block;font-weight: bold; color: #fff;");
var I = document.createElement("a");
I.innerHTML = "Go Back To Watching";
    E = "display: inline-block; margin: 0px auto;background-color: #b2152d;";
E += "margin-top: 10px; padding: 5px 10px;";
E += "color: #fff; border-radius: 5px; border: 1px solid #ccc; cursor: pointer;";
I.setAttribute("style", E);
I.onclick = function() {
document.getElementById("popupSave").remove()
};
G.appendChild(J);
G.appendChild(C);
G.appendChild(I);
document.body.appendChild(G)
//jwplayer().play()
}
}
 jwplayer().addButton(
"https://imgur.com/3Rb4YAU.png",
"GO BACK 30 SEC",
function() {
var position = jwplayer().getPosition(); position -= 30; jwplayer().seek(position);
},
"GO BACK 30 SEC"
);

</script>

Thanks in Advance!

Ps (looking for a system like the Fembed players use on Jwplayer sorta for those familer )


Viewing all articles
Browse latest Browse all 139893

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>