obastemur / mediaserver Goto Github PK
View Code? Open in Web Editor NEWMedia streaming module for node.js http(s) server
License: MIT License
Media streaming module for node.js http(s) server
License: MIT License
This is my exception from node js
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type number
at Function.from (buffer.js:305:9)
at writetop (/Users/vidhya/Documents/youtubify/node_modules/express-session/index.js:285:22)
at ServerResponse.end (/Users/vidhya/Documents/youtubify/node_modules/express-session/index.js:339:16)
at ReadStream. (/Users/vidhya/Documents/youtubify/node_modules/mediaserver/index.js:131:13)
at ReadStream.emit (events.js:210:5)
at ReadStream.EventEmitter.emit (domain.js:478:20)
at internal/fs/streams.js:230:14
at FSReqCallback.oncomplete (fs.js:146:23)
/Volumes/WS/tmp/node_modules/mediaserver/index.js:123
res.write("Media format couldn't found for " + pathmodule.basename(pat
^
ReferenceError: pathmodule is not defined
at Object.exports.pipe (/Volumes/WS/tmp/node_modules/mediaserver/index.js:123:56)
at Server.<anonymous> (/Volumes/WS/tmp/airplay.js:39:6)
at Server.emit (events.js:110:17)
at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:491:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:111:23)
at Socket.socketOnData (_http_server.js:343:22)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)
Have you noticed that with audio files (mp3) they continue to play a few seconds past when they "should". Specifically testing in html5. For example, if you serve an mp3 file and load up the url directly in chrome, it will reach the end but continue playing slightly past the time. Any ideas why this could be?
Hi @obastemur first of all thank you for a very useful library!
I'm trying to run the example that is included in the library and it works on all browsers except desktop Safari.
The same problem occurs when I try to stream my own MP3s. I haven't been able to figure out why, have you noticed this before?
Thank you very much!
-Ricardo.
Any plans to add a transcode for possibilty to reduce data streaming?
Working fine in FF but it's not working either in chrome or chromium in Debian
Hi,
is it possible to start the stream at specific point of time in the mp3/
For example we have an mp3 which is 5 hours long, but we want to start a 1 hour ?
possible ?
-> related: https://gist.github.com/dtrce/1204243
Hi,
what can i do if i get the following error?
"Origin is not allowed by Access-Control-Allow-Origin"
i have tried to modify your response header in index.js like this:
res.writeHead(
206,
{
"Access-Control-Allow-Credentials": true,
"Access-Control-Allow-Origin": (req.headers.origin || "_"),
'Accept-Ranges': 'bytes',
'Content-Range': 'bytes ' + range[0] + '-' + range[1] + '/' + total,
'Content-Length': range[2],
'Content-Type': type,
"Access-Control-Max-Age": 60_60_24_365, // Seconds.
"Access-Control-Allow-Methods": "GET,PUT,POST,DELETE",
"Access-Control-Allow-Headers": "Content-Type"
}
);
but if i do like this i get null error and an empty response on the client and nothing happends...
any suggestion?
Assumed that as you suggests that media server can stream from a specific frame position as for here #6
it's not clear to me how to handle this on the client side. I mean I have start
and end
times in seconds. Of course I have the mp3 file info from ffprobe
so I should calcolate by my self the frames and cut the audio file before then passing it to the mediaserver?
In that case it's just a cut with ffmpeg
but it would prefer to do this in streaming without cutting the file.
Since you are using the method getRange
like
var range = getRange(req, total);
I assume I could send you a req.headers.range
to support this, right? If so could you make an example of the range, it seems it's like a bytes range separated with a -
, so it's to me like
setHeader('range:'+ start_bytes+'-'+end_bytes)
Thank you.
/libs/exts.js line 10:
// ref : http://www.webmaster-toolkit.com/mime-types.shtml
I dunno if this is permanent or not, but it seems like the website www.webmaster-toolkit.com doesn't seem to exist at the moment. I've emailed the webmaster to alert him to this issue in hopes this is a temporary issue.
I tried to pipe .webm files. Doesn't seem to work. Is anyone else facing this issue. Any solutions to this??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.