Domanda

These days I have seen couple of sites (including Youtube) that stream videos through Ajax calls (XHR) in few MBs or even less than MB. For an example of what I said see the highlighted lines in the image below.

enter image description here

I want to know:

  • What this technique is called in programming terminology?
  • How it works?
È stato utile?

Soluzione

A video is a sequence of framed images that are displayed at a rate one after another. If we had all frames of a video clip in our browser, we could display them one after another at a frame rate and there we had our video playing! This sounds like a plan, let us see how we can translate this into an actual web application. From what we planned, we divide our efforts into smaller steps:

Step 1: Getting the frames, frame rate and other necessary information from a video file or a live stream

Step 2: Transport our frames over HTTP to the client’s browser.

Step 3: Animate the frames at the client, response to user interaction and request for more frames if needed.

http://www.codeproject.com/Articles/16092/Streaming-over-HTTP-with-JavaScript-AJAX-video-pla

Altri suggerimenti

billions of websites are using various techniques for streaming their videos to fit the user needs (Internet connection, browser, OS version) are playing a vital role for which technique the server will try to use.

Despite I've made a complete video conference that is working using OpenTok, I am not sure how it works with AJAX Requests, also please note that any streaming technique (viewing video, making video calls) will be just an array of streams that gets pushed over the network.

the idea works like that

1- there is a server (Let's say its the OpenTok Server)


2- Client initiate a request to the server and get token (if its a video conferrence) or will just request a resource through a normal HTTP GET Request.


3- Server will respond with the resource.


4- resource will be an HTML 5 object, Flash or whatever, then the stream will begin from server, there are various techniques here

  • Signal R is one of them
  • XHR Requests
  • Node JS and plenty of other technologies. it starts implementing its own algorithms to request and push stream from the server and to the client. there are other mandatory options that comes in mind when doing so like
    • Type of Encoding
    • FPS etc

please let me know if this is not clarifying info and tell me what do you mean exactly if this is not the answer for what you are looking for.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
scroll top