var chi=document.getElementById("channel").innerHTML ;
var cors_api_url = "";
  function doCORSRequest(options, printResult) {
    var x = new XMLHttpRequest();
    x.open(options.method, cors_api_url + options.url);
    x.onload = x.onerror = function() {
      printResult(x.responseText);
    };
    x.send(options.data);
  }
  // Bind event
  (function load() {
    doCORSRequest({
        method: "GET",
        url:"https://cors-anywhere.herokuapp.com/http://bein.rjh217.win/beinsports"+chi+".php?width=650&height=480",
      }, function printResult(str) {
var res = str.split('<source src="');
var rex = res[1].split('" typ');
var rew=rex[0];
var configxr='<script>player = new Clappr.Player({source: "'+rew+'",mimeType: "application/x-mpegURL",autoPlay: true,height: 360,width: "100%",plugins: {"core": [LevelSelector]},parentId: "#botr_ftKvPcAD_3PGsBfQR_div"});<\/script>';
postscribe("#stream", configxr);
      });

  })();
