File tree Expand file tree Collapse file tree
Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/CDNStreaming Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646
4747public class AudienceFragment extends BaseFragment implements IMediaPlayerObserver {
4848 private static final String TAG = AudienceFragment .class .getSimpleName ();
49- private static final String AGORA_CHANNEL_PREFIX = "rtmp://mdetest2. pull.agoramde .agoraio.cn/live /" ;
49+ private static final String AGORA_CHANNEL_PREFIX = "rtmp://pull.webdemo .agoraio.cn/lbhd /" ;
5050 private boolean isAgoraChannel = true ;
5151 private boolean rtcStreaming = false ;
5252 private String channel ;
@@ -441,7 +441,6 @@ public void run() {
441441 }
442442 break ;
443443 case PLAYER_STATE_PLAYBACK_COMPLETED :
444- mediaPlayer .stop ();
445444 if (mPlayerCompletedDialog == null ) {
446445 mPlayerCompletedDialog = new AlertDialog .Builder (requireContext ())
447446 .setTitle (R .string .tip )
@@ -452,6 +451,7 @@ public void run() {
452451 })
453452 .setCancelable (false )
454453 .setPositiveButton (R .string .confirm , (dialog , which ) -> {
454+ mediaPlayer .stop ();
455455 openPlayerWithUrl ();
456456 })
457457 .create ();
Original file line number Diff line number Diff line change 4040import io .agora .rtc2 .RtcEngine ;
4141import io .agora .rtc2 .RtcEngineConfig ;
4242import io .agora .rtc2 .live .LiveTranscoding ;
43+ import io .agora .rtc2 .video .CameraCapturerConfiguration ;
4344import io .agora .rtc2 .video .VideoCanvas ;
4445import io .agora .rtc2 .video .VideoEncoderConfiguration ;
4546
4647public class HostFragment extends BaseFragment {
4748 private static final String TAG = HostFragment .class .getSimpleName ();
48- private static final String AGORA_CHANNEL_PREFIX = "rtmp://mdetest. push.agoramde .agoraio.cn/live /" ;
49+ private static final String AGORA_CHANNEL_PREFIX = "rtmp://push.webdemo .agoraio.cn/lbhd /" ;
4950
5051 private volatile boolean isAgoraChannel = true ;
5152 private volatile boolean cdnStreaming = false ;
@@ -146,6 +147,12 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
146147 + "}" );
147148 /* setting the local access point if the private cloud ip was set, otherwise the config will be invalid.*/
148149 engine .setLocalAccessPoint (((MainApplication ) getActivity ().getApplication ()).getGlobalSettings ().getPrivateCloudConfig ());
150+
151+ CameraCapturerConfiguration .CaptureFormat captureFormat = new CameraCapturerConfiguration .CaptureFormat ();
152+ captureFormat .fps = 30 ;
153+ engine .setCameraCapturerConfiguration (new CameraCapturerConfiguration (CameraCapturerConfiguration .CAMERA_DIRECTION .CAMERA_FRONT , captureFormat ));
154+
155+ engine .setVideoEncoderConfiguration (new VideoEncoderConfiguration ());
149156 setupEngineConfig (context );
150157 } catch (Exception e ) {
151158 e .printStackTrace ();
You can’t perform that action at this time.
0 commit comments