EasyRTMP 1.3.17.1014 version update

EasyRTMP 1.3.17.1014 version update

This version mainly updates the following contents:

  • About interface adjustments.

    Due to business requirements, the interface of the app needs to play the role of our product promotion at the same time, so we decided to make the content of the interface more perfect, so we changed it to the following:
    About the interface

    This interface uses ConstrantLayout for layout. The code is as follows:

    <?xml version="1.0" encoding="utf-8"?>
    
    <layout xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools">
      <ScrollView
          android:layout_width="match_parent"
          android:layout_height="wrap_content">
          <android.support.constraint.ConstraintLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content">
    
    
              <TextView
                  android:text="EasyRTMP是一套调用简单、功能完善、运行高效稳定的RTMP功能组件,经过多年实战和线上运行打造,支持RTMP推送断线重连、环形缓冲、智能丢帧、网络事件回调,支持Windows、Linux、arm(hisiv100/hisiv200/hisiv300/hisiv400/etc..)、Android、iOS平台,支持市面上绝大部分的RTMP流媒体服务器,能够完美应用于各种行业的直播需求,手机直播、桌面直播、摄像机直播、课堂直播等等方面!\n配套方案推荐:"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:id="@+id/desc"
                  android:layout_marginTop="16dp"
                  app:layout_constraintTop_toBottomOf="@+id/toolbar"
                  app:layout_constraintLeft_toLeftOf="parent"
                  app:layout_constraintRight_toRightOf="parent"
                  android:layout_marginStart="16dp"
                  android:layout_marginLeft="16dp"
                  android:layout_marginEnd="16dp"
                  android:layout_marginRight="16dp" />
    
              <TextView
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="16dp"
                  android:layout_marginTop="8dp"
                  android:id="@+id/rtmp_title"
                  android:layout_marginRight="16dp"
                  android:text="-EasyRTMP推流组件:"
                  app:layout_constraintLeft_toLeftOf="parent"
                  app:layout_constraintRight_toRightOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/desc" />
    
              <ImageView
                  android:id="@+id/imageView"
                  android:layout_width="156dp"
                  android:layout_height="156dp"
                  android:layout_marginLeft="16dp"
                  android:layout_marginRight="16dp"
                  android:layout_marginTop="8dp"
                  android:src="@drawable/android_rtmp"
                  app:layout_constraintLeft_toLeftOf="parent"
                  app:layout_constraintRight_toLeftOf="@+id/guideline"
                  app:layout_constraintTop_toBottomOf="@+id/rtmp_title" />
    
              <TextView
                  android:layout_width="wrap_content"
                  android:text="Android"
                  app:layout_constraintTop_toBottomOf="@+id/imageView"
                  android:layout_marginStart="16dp"
                  app:layout_constraintLeft_toLeftOf="parent"
                  android:layout_marginLeft="16dp"
                  android:layout_marginEnd="16dp"
                  android:id="@+id/android_rtmp_title"
                  android:layout_marginTop="8dp"
                  app:layout_constraintRight_toLeftOf="@+id/guideline"
                  android:layout_height="wrap_content" />
    
              <android.support.constraint.Guideline
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:id="@+id/guideline"
                  app:layout_constraintGuide_percent="0.5"
                  android:orientation="vertical" />
    
    
              <ImageView
                  android:id="@+id/imageView2"
                  android:layout_width="156dp"
                  android:layout_height="156dp"
                  android:layout_marginLeft="16dp"
                  android:layout_marginRight="16dp"
                  android:layout_marginTop="8dp"
                  android:src="@drawable/ios_rtmp"
                  app:layout_constraintLeft_toRightOf="@+id/guideline"
                  app:layout_constraintRight_toRightOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/rtmp_title" />
    
              <TextView
                  android:layout_width="wrap_content"
                  android:text="iOS"
                  app:layout_constraintTop_toBottomOf="@+id/imageView2"
                  android:layout_marginStart="16dp"
                  app:layout_constraintRight_toRightOf="parent"
                  android:layout_marginLeft="16dp"
                  android:layout_marginEnd="16dp"
                  android:layout_marginTop="8dp"
                  app:layout_constraintLeft_toRightOf="@+id/guideline"
                  android:layout_height="wrap_content" />
    
              <TextView
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="16dp"
                  android:layout_marginTop="8dp"
                  android:id="@+id/server_title"
                  android:layout_marginRight="16dp"
                  android:text="-EasyDSS RTMP流媒体服务器:\nhttp://www.easydss.com"
                  app:layout_constraintLeft_toLeftOf="parent"
                  app:layout_constraintRight_toRightOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/android_rtmp_title" />
              <TextView
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="16dp"
                  android:layout_marginTop="8dp"
                  android:id="@+id/player_title"
                  android:layout_marginRight="16dp"
                  android:text="-EasyPlayerPro全功能播放器:\nhttps://github.com/EasyDSS/EasyPlayerPro"
                  app:layout_constraintLeft_toLeftOf="parent"
                  app:layout_constraintRight_toRightOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/server_title" />
    
    
              <ImageView
                  android:id="@+id/imageView_player_pro_android"
                  android:layout_width="156dp"
                  android:layout_height="156dp"
                  android:layout_marginLeft="16dp"
                  android:layout_marginRight="16dp"
                  android:layout_marginTop="8dp"
                  android:src="@drawable/android_player_pro"
                  app:layout_constraintLeft_toLeftOf="parent"
                  app:layout_constraintRight_toLeftOf="@+id/guideline"
                  app:layout_constraintTop_toBottomOf="@+id/player_title" />
    
              <TextView
                  android:layout_width="wrap_content"
                  android:text="Android"
                  app:layout_constraintTop_toBottomOf="@+id/imageView_player_pro_android"
                  android:layout_marginStart="16dp"
                  app:layout_constraintLeft_toLeftOf="parent"
                  android:layout_marginLeft="16dp"
                  android:layout_marginEnd="16dp"
                  android:id="@+id/android_player_pro_title"
                  android:layout_marginTop="8dp"
                  app:layout_constraintRight_toLeftOf="@+id/guideline"
                  android:layout_height="wrap_content" />
    
    
              <ImageView
                  android:id="@+id/imageView_player_pro_ios"
                  android:layout_width="156dp"
                  android:layout_height="156dp"
                  android:layout_marginLeft="16dp"
                  android:layout_marginRight="16dp"
                  android:layout_marginTop="8dp"
                  android:src="@drawable/ios_player_pro"
                  app:layout_constraintLeft_toRightOf="@+id/guideline"
                  app:layout_constraintRight_toRightOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/player_title" />
    
              <TextView
                  android:layout_width="wrap_content"
                  android:text="iOS"
                  app:layout_constraintTop_toBottomOf="@+id/imageView_player_pro_ios"
                  android:layout_marginStart="16dp"
                  app:layout_constraintRight_toRightOf="parent"
                  android:layout_marginLeft="16dp"
                  android:layout_marginEnd="16dp"
                  android:layout_marginTop="8dp"
                  app:layout_constraintLeft_toRightOf="@+id/guideline"
                  android:layout_height="wrap_content" />
    
              <TextView
                  android:text="Copyright © EasyDarwin.org 2012-2017"
                  android:layout_height="wrap_content"
                  android:gravity="center"
                  android:id="@+id/textView3"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/android_player_pro_title"
                  android:layout_marginBottom="8dp"
                  android:layout_marginStart="16dp"
                  app:layout_constraintLeft_toLeftOf="parent"
                  android:layout_marginLeft="16dp"
                  android:layout_marginEnd="16dp"
                  android:layout_marginTop="16dp"
                  app:layout_constraintRight_toRightOf="parent"
                  android:layout_marginRight="16dp"
                  android:layout_width="0dp" />
    
          </android.support.constraint.ConstraintLayout>
      </ScrollView>
    </layout>
  • Support x86, mips architecture

  • On systems 6.0 and above, dynamically obtain camera and recording permissions.

    Android 6.0 and above has added the function of dynamic permissions. Some permissions, such as camera and recording permissions, not only need to be applied for in the Manifest, but also need to be dynamically obtained when the APP is running. If the targetVersion value of the APP is set below 6.0, the system will do Compatible, no need to dynamically obtain it. In this version, we have adapted dynamic permissions.

    At the StreamActivity entry, first check whether you have the relevant permissions? If not, then apply for it.

    if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED ||
                  ActivityCompat.checkSelfPermission(this, android.Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
              ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.CAMERA, android.Manifest.permission.RECORD_AUDIO}, REQUEST_CAMERA_PERMISSION);
              mNeedGrantedPermission = true;
              return;
          } else {
              // resume..
          }

    After sending requestPermissions , the system will pop up a dialog box for the user to confirm. After the user confirms, it will enter the onRequestPermissionsResult callback. In the callback, determine whether the user agrees.

    After the user agrees to the authorization, start the camera to push.

  • When uploading a video in the background, you need to dynamically obtain the "display on top" permission.

    In the system of 6.0 and above, the VIEW format of TYPE_SYSTEM_OVERLAY is restricted, and the application needs to obtain "running at the top level" to create this kind of view. We need to create this kind of view for video capture. Android provides a method to Determine whether you have this permission:

    Settings.canDrawOverlays(this);

    Different from ordinary permission acquisition, this permission needs to open the setting interface for authorization, and check the authorization status in onActivityResult . We apply for this permission to the user when checking Enable background collection in the setting interface.

    The relevant code is as follows:

    if (!Settings.canDrawOverlays(SettingActivity.this)) {
    new AlertDialog.Builder(SettingActivity.this).setTitle("后台上传视频").setMessage("后台上传视频需要APP出现在顶部.是否确定?").setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
      @Override
      public void onClick(DialogInterface dialogInterface, int i) {
    
        final Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + BuildConfig.APPLICATION_ID));
        startActivityForResult(intent, REQUEST_OVERLAY_PERMISSION);
      }
    }).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
      @Override
      public void onClick(DialogInterface dialogInterface, int i) {
        PreferenceManager.getDefaultSharedPreferences(SettingActivity.this).edit()
          .putBoolean(KEY_ENABLE_BACKGROUND_CAMERA, false).apply();
        buttonView.toggle();
      }
    }).setCancelable(false).show();
    }

    Determine whether the permission is obtained in onActivityResult :

      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          if (requestCode == REQUEST_OVERLAY_PERMISSION) {
              if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                  boolean canDraw = Settings.canDrawOverlays(this);
                  PreferenceManager.getDefaultSharedPreferences(SettingActivity.this).edit()
                          .putBoolean(KEY_ENABLE_BACKGROUND_CAMERA, canDraw).apply();
                  if (!canDraw){
                      CheckBox backgroundPushing = (CheckBox) findViewById(R.id.enable_background_camera_pushing);
                      backgroundPushing.setChecked(false);
                  }
              }
          }
      }

About EasyRTMP Streaming SDK

EasyRTMP is a set of RTMP functional components with simple calls, complete functions, efficient and stable operation. After years of actual combat and online operation, it supports RTMP push disconnection and reconnection, ring buffering, intelligent frame loss, network event callback, and supports Windows and Linux. , arm (hisiv100/hisiv200/hisiv300/hisiv400/etc..), Android, iOS platform, supports most of the RTMP streaming media servers on the market, including Red5, Ngnix_rtmp, crtmpserver and other mainstream RTMP servers, can be perfectly applied to various Live broadcast needs of the industry, mobile live broadcast, desktop live broadcast, camera live broadcast, classroom live broadcast, etc.!

Click the link to join the group [EasyRTMP-RTMP live push]: 587254841

Get more information

Email: [email protected]

WEB:www.EasyDarwin.org

Copyright © EasyDarwin.org 2012-2017

EasyDarwin

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325472081&siteId=291194637