pull/2/head
knotteye 2020-10-17 22:40:30 -05:00
parent 1fa6bf7e81
commit 90cce68581
3 changed files with 26 additions and 3 deletions

View File

@ -186,7 +186,7 @@ async function startVideo(){
//player.initialize(document.querySelector("#videoPlayer"), url, true); //player.initialize(document.querySelector("#videoPlayer"), url, true);
//console.log('called startvideo'); //console.log('called startvideo');
while(true){ while(true){
if(document.querySelector('#videoPlayer') === null) if(!document.querySelector('#videoPlayer'))
break; break;
if(window.location.pathname.substring(window.location.pathname.length - 1) !== '/'){ if(window.location.pathname.substring(window.location.pathname.length - 1) !== '/'){

View File

@ -12,6 +12,29 @@
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send(""); xhr.send("");
} }
function makeRequest(method, url, payload) {
return new Promise(function (resolve, reject) {
let xhr = new XMLHttpRequest();
xhr.open(method, url);
xhr.onload = function () {
if (this.status >= 200 && this.status < 300) {
resolve(xhr.response);
} else {
reject({
status: this.status,
statusText: xhr.statusText
});
}
};
xhr.onerror = function () {
reject({
status: this.status,
statusText: xhr.statusText
});
};
!payload ? xhr.send() : xhr.send(payload);
});
}
</script> </script>
{% block head %} {% block head %}
{% endblock %} {% endblock %}

View File

@ -4,13 +4,13 @@
<link rel="stylesheet" type="text/css" href="/videojs/video-js.min.css">--> <link rel="stylesheet" type="text/css" href="/videojs/video-js.min.css">-->
<script src="/dashjs/dash.all.min.js"></script> <script src="/dashjs/dash.all.min.js"></script>
<script> <script>
async function startVideo(){ async function startVideo(){
//var url = "/live/{{username}}/index.mpd"; //var url = "/live/{{username}}/index.mpd";
//var player = dashjs.MediaPlayer().create(); //var player = dashjs.MediaPlayer().create();
//player.initialize(document.querySelector("#videoPlayer"), url, true); //player.initialize(document.querySelector("#videoPlayer"), url, true);
//console.log('called startvideo'); //console.log('called startvideo');
while(true){ while(true){
if(document.querySelector('#videoPlayer') === null) if(!document.querySelector('#videoPlayer'))
break; break;
if(window.location.pathname.substring(window.location.pathname.length - 1) !== '/'){ if(window.location.pathname.substring(window.location.pathname.length - 1) !== '/'){