Jump to content
  • 0

Receiving video stream when video is not requested


Lucas Nogueira
 Share

Question

Receiving video stream when video is not requested

I have a stream that's been published with the following command:

{ command : "publish", streamId : "someStreamId", token : "someTokenId", video: "true", audio: "true"}

All is good and I am able to play this stream back. However, I have certain sessions that only require the audio stream. Due to this, I have been trying to not receive the video stream by sending the following command:

{ command : "play", streamId : "someStreamId", token : "someTokenId", video: "false", audio: "true"}

By sending the above command with the video key set to false, I am expecting to only receive an audio stream, but I am still receiving the published video track on my list of tracks.

The Ant Media Server version I am using is: v2.1.0.

Is this a bug in the version I am using? If not, how can I only receive the audio stream?

 

Link to comment
Share on other sites

  • Answers 6
  • Created
  • Last Reply

Top Posters For This Question

6 answers to this question

Recommended Posts

  • 0

Hi,

Have a good day.

We don't use video: "false", audio: "true" parameters for playing.

Please use <audio> tag for WebRTC Audio playing. You can check WebRTC Audio sample page: https://github.com/ant-media/StreamApp/blob/master/src/main/webapp/audio_player.html

I hope, I could help you.
Link to comment
Share on other sites

  • 0

Selim,

 

Since it's not possible to use those parameters to request audio only, is there any way other way to receive audio only from a stream published with audio and video?

 

By the way, I am not using the javascript API, I'm working on a native application communicating with AMS through the websocket API.

 

Thanks for your time,

Lucas

 

 

 

Link to comment
Share on other sites

  • 0

I'm writing the same answer that I have written in the Github issue so everyone can see: https://github.com/ant-media/Ant-Media-Server/issues/3411

There is a built-in command in Ant Media for toggling both audio and video. Here is the repository;

https://github.com/ant-media/StreamApp/blob/master/src/main/webapp/js/webrtc_adaptor.js

You can use this command for disabling the video; StreamId and the tracking id should be the same if you aren't using multi-track. For the enabled command you can input true or false depending on your needs.

{

command : "toggleVideo",

streamId: streamId,

trackId: trackId,

enabled: enabled,

}

Regards,

Cem

Link to comment
Share on other sites

 Share

×
×
  • Create New...