Jump to content
  • 0

Android SDK Mode_Play set autoplay stream


robertosamayoa
 Share

Question

Hello, i was testing android sdk and first time i am able to run and test and works perfect,  but i have one question one Mode_Play,

i see we have to set stream id on mainactivityjava to user be able to press button play and will play that stream.

1./ How i implement autoplay no need to press start playing button.

 

 

Link to comment
Share on other sites

  • Answers 6
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

6 answers to this question

Recommended Posts

  • 0

Hi, could you explain the desired functionality? 

Currently, you need to input the stream id and then click play. Do you want to auto-play after the stream id has been entered into the text box?

What is the reason to eliminate the play button?

Link to comment
Share on other sites

  • 0

I think @robertosamayoa is trying to play video when view is loaded on mobile. He might be calling active stream on page load using api.

As far as i know in JS sdk, I used to pass attribute "muted" and "autoplay" in html5 video tag. Also as per browser policy its not allowed. Have a look at google autoplay policy.

Link to comment
Share on other sites

  • 0
2 hours ago, rahul7827 said:

I think @robertosamayoa is trying to play video when view is loaded on mobile. He might be calling active stream on page load using api.

As far as i know in JS sdk, I used to pass attribute "muted" and "autoplay" in html5 video tag. Also as per browser policy its not allowed. Have a look at google autoplay policy.

hi, on JS sdk i know is limited by privacy there i dont have any problem, but i am asking on android sdk 

i am running mode play on code i haved to set stream id, but on interface i just want people when enter into stream no need to press start button, just start playing. look image. 

 

WhatsApp Image 2023-02-16 at 1.42.06 PM.jpeg

Link to comment
Share on other sites

  • 0
On 2/16/2023 at 1:45 PM, robertosamayoa said:

hi, on JS sdk i know is limited by privacy there i dont have any problem, but i am asking on android sdk 

i am running mode play on code i haved to set stream id, but on interface i just want people when enter into stream no need to press start button, just start playing. look image. 

 

WhatsApp Image 2023-02-16 at 1.42.06 PM.jpeg

???

Link to comment
Share on other sites

  • 0

 When the play button is clicked it's calling the 

startStreaming()

method in MainActivity.java.

The start playing button executes the startStreaming() method.

As an example, I was able to make the live stream start automatically after clicking the "Simple Play" button on the sample page without having to click the play button by just calling that method at the end of the main onCreate method when the activity loads in MainActivity.java.

This example does set the correct stream id statically to "test" in:

webRTCClient.setStreamId("test");

so if you want it to be dynamic, then you will need to make further changes.

Here is a screenshot attached.

image.thumb.png.f54f1aaef73b19e1e62c53d849cdf2f8.png

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...