Availability Per Account Type

Trial

Lite

Pro

White Label

WL – Custom

Introduction

You will be able to use the Protect_Player() functionto add a basic login feature to view a player.

Notes:

  • The password you use needs to be a single phrase.
  • Use only characters and numbers as your password.
  • No special characters, and no spaces for your password.
  • The end user will have 3 login attempts per page load, then the login option will turn off.

Getting Started

Step 1. Place this script shown below in your website’s header tag. 

Sample Code – Click to expand / collapse

<script>
    Protect_Player = function(Container, Login, Password){
        A = 1;//Attempts
        C = document.getElementById(Container);
        C.style.display = "none";
        L = document.getElementById(Login);
        L.innerHTML = "Login to view this video.<br/>Password: <input id='"+ L + "_PW' type='password'/><button id='"+ L + "_BTN'>Login</button>";
        L_PW = document.getElementById(L+"_PW");
        L_BTN = document.getElementById(L+"_BTN");
        L_BTN.onclick = function(){
            if(A < 3){
                if(L_PW.value == Password){
                    C.style.display = "block";
                    L.style.display = "none";
                }else{
                    A++;
                    alert("The password you entered was incorrect, please try again.");
                    L_PW.value = "";
                    L_PW.focus();
                }
            }else{
                L.innerHTML = "Login Failed";
            }
        }
    }   
</script>

Step 2. Place this script in the body of your web page where you wish the player to show up.

Sample Code – Click to expand / collapse

<div id="Container">
    Player Embed Code Here
</div>
<div id="Login"></div>
<script>Protect_Player("Container", "Login",  "Password");</script>

Step 3. Log into your EZWebPlayer account and grab your players embed code. This will work with the Iframe and Javascript embed codes.

And replace the line from Step 2 that saysPlayer Embed Code Here with your player code.

Sample Code – Click to expand / collapse

<div id="Container">
    <iframe src="https://ezwp.tv/iframe.htm?v=0000000&w=600&h=450" style="border-width:0;width:600px;height:450px" scrolling="no" allowFullScreen></iframe>
</div>
<div id="Login"></div>
<script>Protect_Player("Container", "Login",  "Password");</script>

Protect_Player() – Pass it 2 variables.

Container ID“Container”The value of the ID attribute for the div container that will house your player’s embed code.
Login ID“Login”The value of the ID attribute for the div container that will house your player’s login form.
Password“Password”The login password’s value. Make sure to keep this one phrase and only use numbers and characters. No spaces. No special characters.

Resulting Player

Input the value ‘Password’ and click on the login button.