How to embed a m3u8 stream - m3u8

is it possible to embed an m3u8 stream?
i tried several players and stuff but it just don't play, is it something about crossdomain?
here is what i got
https://html.house/f16jzx1y.html

You must configure CORS server side. If you do not control the server, then it’s not possible to embedded the stream in another domain. That is exactly the purpose of CORS.

Related

How the server really handle the response to a http request?

I understand that the server send website components to the client after http request, HTML, CSS, Js and other static files that are necessary to build the website in the client browser.
I want to understand what the server actually do to generate the response since it should handle many requests not just one request??
I assume that the server create an instance from the files and send it to the client via http response?? is this right, wrong,inaccurate or incomplete or are there other processes that happen on the server to make it work??
These "website components" (code for the browser) can be created by the server however it wants. There are two typical patterns. Static and dynamic.
Static resources are created ahead of time. These cannot be customised by the server at the time of the request.
Dynamic resources will be generated when the request is received. For example, a HTML asset may be generated to include a particular user's username as found in a cookie sent with the request. This is typically done from templates like jinja2 for Python.
Nowadays serving these resources statically and using a client side JavaScript application with a separate data API to customise content is the most popular way to build interactive websites (web apps)

How do I upload a video to YouTube via an HTTP request?

I've been trying to figure this out for hours now. Consulting the official documentation It says I need to make a post request to https://www.googleapis.com/upload/youtube/v3/videos with a content type header set to video/* or application/octet-stream (I've used the latter). Turns out if I just post a buffer of a video file to that url it'll work. But the documentation also says I can specify a whole bunch of options about the video (title, description, tags, etc.) However, it says to attach that information to the request body! I'm confused on how I'm supposed to send both the video bytes and the options in the same request. Maybe it's not supposed to be the same request, but they don't mention anything about using multiple.
Uploading videos using Youtube API is done using a protocol that Google calls "Resumable Uploads Protocol". Google uses this protocol across their APIs (i.e. Drive, Youtube etc.) and is recommended in the following scenarios
Uploading large file
Unreliable network connection.
The full details of how to use "Resumable Uploads Protocol" with the Youtube API can be found at https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol.
The following is a simplified set of steps:
Create a resumable upload session by sending a POST request to the insert API endpoint.
Read the resumable session URI from the Location header of the above request.
Upload the video by sending a PUT request with binary video data as body to the resumable session URI.

JSF resumable File Upload

I want to upload files with JSF. I want to be able to resume an upload after a pause (voluntarily or not).
They will be about 500Mb in size.
I'm working with PrimeFaces, which has a neat FileUpload-Tag, but it doesn't let me pause/resume uploads.
I did some research on this. The most common answer is "Use an FTP-Client". Others were Java-Applets or Flash.
It should work on the current Firefox/Chrome and IE8.
It's indeed not possible to resume file uploads via HTML <input type="file"> element. There's namely nothing in the multipart/form-data encoding which would ever support that. Even more, there's no standard form encoding specification which supports that. You'd basically need to invent a custom HTTP request format.
In Java terms, your best bet is to homebrew an applet or webstart application for this which uses Swing JFileChooser to pick files and uses URLConnection to send it via HTTP to the server. In the server side, you'd need a custom Servlet which understands the custom request format and processes the partial upload accordingly.
There's a 3rd party applet which is capable of this all: JumpLoader. Its homepage is at the moment unfortunately down (you could however try Google Cache). To the point, it sends some specific HTTP request parameters along with the multipart/form-data upload request telling the server side if it's a partial upload and if so at which index it should start, so that the servlet can glue the pieces together.
Then, to integrate this all with JSF, your best bet is to let the applet pass the session ID around as URL path fragment so that the servlet shares the same HTTP session as the JSF application. This way the upload servlet can access session scoped JSF managed beans and/or the JSF application can poll for some servlet-specific variables in the HTTP session.

Encrypt the song url in flex audio player

HI am new to AMFPHP. am creating flex audio player.
Whenever am playing the song in my player. the song url will be displayed by the use of FIREBUG addons..
How can i encrypt and decrypt that url using AMFPHP or PHP.
Some flash audio players done this job using AMFPH..
Edit/Delete Message
You can't. Firebug's Net tab sees all HTTP[S] net traffic. If you want to stream a song to the browser without an HTTP URL being visible in Firebug, you would have to use a different protocol to HTTP — typically RTMP.
The way some sites protect HTTP streams is to use a one-time URL, so that the player generates an authentication token (typically using crypto hashing) and that can only be used to download the stream once; it is served with Cache-Control: no-cache header to stop the browser storing it on disc and making it available to the user for download from the Net tab. Defeating caching of course does mean that you'll serving a lot more data unnecessarily. And it's still pretty easy to circumvent.
Don't imagine you can solve the Copy Protection Problem. Even “protected” RTMPE is very much downloadable.

Better file uploading approach: HTTP post multipart or HTTP put?

Use-case: Upload a simple image file to a server, which clients could later retrieve
Designate a FTP Server for the job.
HTTP Put: It can directly upload files to a server without the need of a server side
component to handle the bytestream.
HTTP Post: Handle the bytestream by the server side component.
I think to safely use PUT on a public website requires even more effort than using POST (and is less commonly done) due to potential security issues. See http://bitworking.org/news/PUT_SaferOrDangerous.
OTOH, I think there are plenty of resources for safely uploading files with POST and checking them in the server side script, and that this is the more common practice.
PUT is only appropriate when you know the URL you are putting to.
You could also do:
4) POST to obtain a URL to which you then PUT the file.
edit: how are you going to get the HTTP server to decide whether it is OK to accept a particular PUT request?
What I usually do (via PHP) is HTTP POST.
And employ PHP's move_uploaded_file() to get it to whatever destination I want.

Resources