问题
Okay I'm using this code; and I'm curious to know why it isn't streaming to my RTMP server; I have tried connecting to my Red5 RTMP server through OBS which is a broadcasting program and it works fine but when using this script it doesn't broadcast the webcam I'm just wondering if I'm missing any variables which is preventing me from connecting to the rtmp server or something. Thank you for any help!
<embed src="webcam.swf"
flashvars="server=rtmp://ip/path/usertoken"
bgcolor="#ffffff"
width="800"
height="900"
quality="high"
allowScriptAccess="always"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
In the readme of the setup there are some variables which I didn't understand how to use so I'm going to paste them below:
### FlashVars
* server : rtmp server
* stream : rtmp stream to publish
* token : (optional)
* camerawidth : default 640
* cameraheight : default 480
* camerafps : default 15
this is the main one that I didn't understand
with swfobject
:
var flashvars = {server : "rtmp://localhost/live",
stream : "plop"};
var params = {};
var attributes = {};
swfobject.embedSWF("webcam.swf", "myId", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);
来源:https://stackoverflow.com/questions/35102035/streaming-webcam-rtmp-support