robertosamayoa Posted February 16 Share Posted February 16 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 More sharing options...
0 Tim Posted February 16 Share Posted February 16 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 More sharing options...
0 rahul7827 Posted February 16 Share Posted February 16 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 More sharing options...
0 robertosamayoa Posted February 16 Author Share Posted February 16 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. Link to comment Share on other sites More sharing options...
0 robertosamayoa Posted February 27 Author Share Posted February 27 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. ??? Link to comment Share on other sites More sharing options...
0 Tim Posted February 27 Share Posted February 27 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. Link to comment Share on other sites More sharing options...
0 robertosamayoa Posted March 2 Author Share Posted March 2 thanks adding these works for me this.startStreaming(); } public void startStreaming() { and StartStreaming adding to Webrtcclient.java SetStreamid Didnt work i guess because was already set . Link to comment Share on other sites More sharing options...
Question
robertosamayoa
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
Top Posters For This Question
4
2
1
Popular Days
Feb 16
4
Feb 27
2
Mar 2
1
Top Posters For This Question
robertosamayoa 4 posts
Tim 2 posts
rahul7827 1 post
Popular Days
Feb 16 2023
4 posts
Feb 27 2023
2 posts
Mar 2 2023
1 post
Posted Images
6 answers to this question
Recommended Posts