http-streaming

Twitter's method for streaming API on w3c

允我心安 提交于 2019-12-03 21:49:03
I am interested in building a streaming API (read-only) similar to what Twitter has built. Data will only be going unidirectional, from server to client. Clients do not have to be web browsers but merely anything that can technically keep a persistent HTTP connection open. I'm fairly certain what Twitter's streaming API is doing is not WebSockets and not COMET. I was wondering if the technology/strategy that they deployed is one with a w3c specification that one can study. I don't necessarily see any links to their strategy on W3C - so it might be something "custom" but any point in the right

Android Record raw bytes into WAVE file for Http Streaming

柔情痞子 提交于 2019-12-03 09:03:56
So I am using AudioRecord from Android to record raw bytes and for writing them into a .wav file. Since Android has no support for this I had to write the .wav file headers manually with the following code: randomAccessWriter.writeBytes("RIFF"); randomAccessWriter.writeInt(0); // Final file size not known yet, write 0 randomAccessWriter.writeBytes("WAVE"); randomAccessWriter.writeBytes("fmt "); randomAccessWriter.writeInt(Integer.reverseBytes(16)); // Sub-chunk size, 16 for PCM randomAccessWriter.writeShort(Short.reverseBytes((short) 1)); // AudioFormat, 1 for PCM randomAccessWriter.writeShort

HTTP streaming in rails not working when using Rack::Deflater

被刻印的时光 ゝ 提交于 2019-11-30 09:54:46
I've setup unicorn in rails 3.1 and http streaming works until I enable Rack::Deflater. I've tried both with and without use Rack::Chunked. In curl I can see my response while in chrome I get the following errror: ERR_INVALID_CHUNKED_ENCODING The result is same in other browsers (firefox, safari) and between development (osx) and production (heroku). config.ru: require ::File.expand_path('../config/environment', __FILE__) use Rack::Chunked use Rack::Deflater run Site::Application unicorn.rb: listen 3001, :tcp_nopush => false worker_processes 1 # amount of unicorn workers to spin up timeout 30

How to implement the Adobe HTTP Streaming spec without using their Streaming server

寵の児 提交于 2019-11-30 02:31:41
As of Flash 10.1, they have added the ability to add bytes into the NetStream object via the appendBytes method (described here http://www.bytearray.org/?p=1689 ). The main reason for this addition is that Adobe is finally supporting HTTP streaming of video. This is great, but it seems that you need to use the Adobe Media Streaming Server ( http://www.adobe.com/products/httpdynamicstreaming/ ) to create the correct video chunks from your existing video to allow for smooth streaming. I have tried to do a hacked version of HTTP streaming in the past where I swap out the NetStream objects

akka-http send continuous chunked http response (stream)

て烟熏妆下的殇ゞ 提交于 2019-11-29 15:13:46
问题 I have this crude test example with akka-http client and server. Server.scala: import akka.actor.ActorSystem import akka.stream.ActorMaterializer import akka.stream.scaladsl.Sink import akka.http.scaladsl.Http import akka.http.scaladsl.model.HttpMethods._ import akka.http.scaladsl.model._ import scala.concurrent.Future class Server extends Runnable { def run() = { implicit val system = ActorSystem("server") implicit val materializer = ActorMaterializer() val serverSource = Http().bind

Long Polling with Spring's DeferredResult

我与影子孤独终老i 提交于 2019-11-29 01:56:57
The client periodically calls an async method (long polling), passing it a value of a stock symbol, which the server uses to query the database and return the object back to the client. I am using Spring's DeferredResult class, however I'm not familiar with how it works. Notice how I am using the symbol property (sent from client) to query the database for new data (see below). Perhaps there is a better approach for long polling with Spring? How do I pass the symbol property from the method deferredResult() to processQueues() ? private final Queue<DeferredResult<String>> responseBodyQueue =

How to implement the Adobe HTTP Streaming spec without using their Streaming server

对着背影说爱祢 提交于 2019-11-28 23:31:26
问题 As of Flash 10.1, they have added the ability to add bytes into the NetStream object via the appendBytes method (described here http://www.bytearray.org/?p=1689). The main reason for this addition is that Adobe is finally supporting HTTP streaming of video. This is great, but it seems that you need to use the Adobe Media Streaming Server (http://www.adobe.com/products/httpdynamicstreaming/) to create the correct video chunks from your existing video to allow for smooth streaming. I have tried

My Understanding of HTTP Polling, Long Polling, HTTP Streaming and WebSockets

笑着哭i 提交于 2019-11-28 14:56:12
I have read many posts on SO and the web regarding the keywords in my question title and learned a lot from them. Some of the questions I read are related to specific implementation challenges while others focus on general concepts. I just want to make sure I understood all of the concepts and the reasoning why technology X was invented over technology Y and so on. So here goes: Http Polling: Basically AJAX, using XmlHttpRequest. Http Long Polling: AJAX but the server holds on to the response unless the server has an update, as soon as the server has an update, it sends it and then the client

Consuming chunked data asyncrhonously in javascript

和自甴很熟 提交于 2019-11-28 01:48:11
问题 I have a (GET) endpoint that sends data in chunks (Transfer-Encoding: chunked). The data is JSON encoded and sent line by line. Is there a way to consume the data sent by this endpoint in an asynchronous manner in JavaScript (or using some JavaScript library)? To be clear, I know how to perform an asynchronous GET , but I would like to have the GET request not waiting for the whole data to be transfered, but instead read the data line by line as it arrives. For instance, when doing: curl http

Sorry, this video is not valid for streaming to this device in Http streaming android

与世无争的帅哥 提交于 2019-11-27 22:37:45
I can stream some videos from URL (server) successfully, But the others (my video up to my server) is not . You can see both in my code (Working/Not working) I'm on stuck with this problem. "Sorry, this video is not valid for streaming to this device" The following code : String url = null; // url = "rtsp://v5.cache5.c.youtube.com/CiILENy73wIaGQmC00ZlwwIDOxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp"; // Working // url = "http://daily3gp.com/vids/747.3gp"; // Working url = "http://www.ooklnet.com/files/381/381489/video.mp4"; // Working // url = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";