Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async createStream(streamName,rtmpUrl)
{
const videoStreamer = medoozeMediaServer.createStreamer();
const audioStreamer = medoozeMediaServer.createStreamer();
const video = new MediaInfo(streamName+':video','video');
const audio = new MediaInfo(streamName+':audio','audio');
//Add h264 codec
video.addCodec(new CodecInfo(videoCodec,videoPt));
audio.addCodec(new CodecInfo(audioCodec,audioPt));
if (!videoPort) {
videoPort = await this.getMediaPort();
audioPort = await this.getMediaPort();
}
async createStream(streamName,rtmpUrl)
{
const videoStreamer = medoozeMediaServer.createStreamer();
const audioStreamer = medoozeMediaServer.createStreamer();
const video = new MediaInfo(streamName+':video','video');
const audio = new MediaInfo(streamName+':audio','audio');
//Add h264 codec
video.addCodec(new CodecInfo(videoCodec,videoPt));
audio.addCodec(new CodecInfo(audioCodec,audioPt));
if (!videoPort) {
videoPort = await this.getMediaPort();
audioPort = await this.getMediaPort();
}
const videoSession = videoStreamer.createSession(video, {
//Get Semantic SDP objects
const SemanticSDP = require("semantic-sdp");
const SDPInfo = SemanticSDP.SDPInfo;
const MediaInfo = SemanticSDP.MediaInfo;
const CandidateInfo = SemanticSDP.CandidateInfo;
const DTLSInfo = SemanticSDP.DTLSInfo;
const ICEInfo = SemanticSDP.ICEInfo;
const StreamInfo = SemanticSDP.StreamInfo;
const TrackInfo = SemanticSDP.TrackInfo;
const Direction = SemanticSDP.Direction;
const CodecInfo = SemanticSDP.CodecInfo;
//Create new streamer
const streamer = MediaServer.createStreamer();
//Create new video session codecs
const video = new MediaInfo("video","video");
//Add h264 codec
video.addCodec(new CodecInfo("h264",96));
//Create session for video
const session = streamer.createSession(video,{
local : {
port: 5004
}
});
module.exports = function(request,protocol,endpoint)
{