Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Level Selector not working correctly cors #70

Open
thianekhalipha opened this issue Jun 15, 2018 · 8 comments
Open

Level Selector not working correctly cors #70

thianekhalipha opened this issue Jun 15, 2018 · 8 comments

Comments

@thianekhalipha
Copy link

Here is my request the m3u link fine in every player VLC , HLS TESTER and many
I wainting your reply please help me

<script type="text/javascript" src="https://cdn.jsdelivr.net/clappr/latest/clappr.min.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/clappr.level-selector/latest/level-selector.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <title>clappr-level-selector-plugin Test Page</title> <script type="text/javascript" charset="utf-8"> window.onload = function() { var player = new Clappr.Player({ source: 'http://eu10.acangroup.org:1935/output/asfiyahi.stream/playlist.m3u8', parentId: '#player-wrapper',
plugins: {
  core: [LevelSelector],
},

width: 640, height: 360,
hideMediaControl: false,
autoPlay: false

});
};

</script>
@leandromoreira
Copy link
Member

Hi,

It seems that you are facing a cors issue, when I ran the command to see your server headers:

$ curl -v http://eu10.acangroup.org:1935/output/asfiyahi.stream/playlist.m3u8
*   Trying 149.202.71.148...
* TCP_NODELAY set
* Connected to eu10.acangroup.org (149.202.71.148) port 1935 (#0)
> GET /output/asfiyahi.stream/playlist.m3u8 HTTP/1.1
> Host: eu10.acangroup.org:1935
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Server: WowzaStreamingEngine/4.3.0
< Cache-Control: no-cache
< Date: Fri, 15 Jun 2018 23:37:35 GMT
< Content-Type: application/vnd.apple.mpegurl
< Content-Length: 136
<
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=1645824,CODECS="avc1.77.30,mp4a.40.2",RESOLUTION=720x480
chunklist_w998693492.m3u8
* Connection #0 to host eu10.acangroup.org left intact

It showed me that your server do not add the needed cors headers, VLC plays it because it's not restricted by a browser.

To sum up, if you want to play your content on a browser you must add cors to your server.

@thianekhalipha
Copy link
Author

It is also working on ( https://www.hlsplayer.net ) so there is a way to make it work on CLAPPR
I'm using Worpress site please tell how I can do it .

@leandromoreira
Copy link
Member

I think you need to add cors headers to the server eu10.acangroup.org your support team can help you and if this stream is hosted on wordpress you can search on the Internet by "add cors headers wordpress"

@thianekhalipha
Copy link
Author

So it's not posssible with the plugin it's self
Help please I hade eu10.acangroup.org:1935 on the header of my site buy same error
This is what I try with clappr

<script type="text/javascript" src="https://cdn.jsdelivr.net/clappr/latest/clappr.min.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/clappr.level-selector/latest/level-selector.min.js"></script> <style> #oper { position:absolute; height:100%; width:100%; z-index:999999999999999999999999999999999; } </style> <script type="text/javascript" data-cfasync="false">

var strm = "http://eu10.acangroup.org:1935/output/asfiyahi.stream/playlist.m3u8" ;
if( strm ) {
}
else
window.location.href = "empty.php";
</script>

<script>

var playerElement = document.getElementById("ppp");
var player = new Clappr.Player({
source: strm ,
height: "100%",
width: "100%",
parentId: "#ppp",
plugins: [LevelSelector],
mimeType: "application/x-mpegURL",
autoPlay: false,
});
(function (open) {
XMLHttpRequest.prototype.open = function (method, url, async, user, pass) {

var rewrittenUrl = url ;

    if (url.indexOf("eu10.acangroup.org:1935") !== -1){

                rewrittenUrl = "" + btoa(url);

}

open.call(this, method, rewrittenUrl, async, user, pass);
};

})(XMLHttpRequest.prototype.open);
</script>

NOW I have no cross error but this
image

So the way I do it with the the selector is not correct ?

@leandromoreira
Copy link
Member

The way you're using the plugin seems right but now your server is returning 404, not found.

@thianekhalipha
Copy link
Author

Oui mais ça marche pas .

@thianekhalipha
Copy link
Author

Yeah but it is not working I want to know how to make it work

@leandromoreira
Copy link
Member

I really can't help you this is something related to your server infrastructure not clappr or its plugins, you should ask help for your support team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants