Skip to content

Commit

Permalink
Revert "Add backgroiund replacement code"
Browse files Browse the repository at this point in the history
This reverts commit 12d76d8.
  • Loading branch information
goncalocostamendes committed Jan 25, 2024
1 parent 12d76d8 commit 54fb003
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Video-Transformers-Java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {

dependencies {
// Dependency versions are defined in the ../../commons.gradle file
implementation "com.opentok.android:opentok-android-sdk:2.27.0"
implementation "com.opentok.android:opentok-android-sdk:2.25.2"
implementation "androidx.appcompat:appcompat:${extAppCompatVersion}"
implementation "pub.devrel:easypermissions:${extEasyPermissionsVersion}"
implementation "androidx.constraintlayout:constraintlayout:${extConstraintLyoutVersion}"
Expand Down
1 change: 0 additions & 1 deletion Video-Transformers-Java/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.Manifest;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
Expand Down Expand Up @@ -40,7 +39,6 @@
import retrofit2.Retrofit;
import retrofit2.converter.moshi.MoshiConverterFactory;

import java.io.File;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -207,7 +205,7 @@ public void onPermissionsDenied(int requestCode, List<String> perms) {

@AfterPermissionGranted(PERMISSIONS_REQUEST_CODE)
private void requestPermissions() {
String[] perms = {Manifest.permission.INTERNET, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.READ_EXTERNAL_STORAGE};
String[] perms = {Manifest.permission.INTERNET, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO};

if (EasyPermissions.hasPermissions(this, perms)) {

Expand Down Expand Up @@ -356,25 +354,10 @@ public void onTransform(BaseVideoRenderer.Frame frame){
public void SetVideoTransformers(View view) {
if(!isSet) {
videoTransformers.clear();
String resourceName;
try {
resourceName = getResources().getResourceEntryName(R.drawable.beach); // Assuming "beach" is the name of the drawable resource
} catch (Resources.NotFoundException e) {
return; // Return if the resource ID is not found
}

File imageFile = new File(getBaseContext().getFilesDir(), resourceName + ".jpeg");

//ArrayList<PublisherKit.VideoTransformer> videoTransformers = new ArrayList<>();
PublisherKit.VideoTransformer backgroundReplacement = publisher.new VideoTransformer(
"BackgroundReplacement",
"{\"image_file_path\":\"" + imageFile.getAbsolutePath() + "\"}"
);
videoTransformers.add(backgroundReplacement);
//PublisherKit.VideoTransformer backgroundBlur = publisher.new VideoTransformer("BackgroundBlur", "{\"radius\":\"High\"}");
//PublisherKit.VideoTransformer myCustomTransformer = publisher.new VideoTransformer("myTransformer", logoTransformer);
//videoTransformers.add(backgroundBlur);
//videoTransformers.add(myCustomTransformer);
PublisherKit.VideoTransformer backgroundBlur = publisher.new VideoTransformer("BackgroundBlur", "{\"radius\":\"High\"}");
PublisherKit.VideoTransformer myCustomTransformer = publisher.new VideoTransformer("myTransformer", logoTransformer);
videoTransformers.add(backgroundBlur);
videoTransformers.add(myCustomTransformer);
publisher.setVideoTransformers(videoTransformers);
isSet = true;
buttonVideoTransformers.setText("Reset");
Expand Down
Binary file not shown.

0 comments on commit 54fb003

Please sign in to comment.