Skip to content

Commit 62b282f

Browse files
committed
Upgrades pigeon & solid_lints, makes takeSnapshot nullable
1 parent 757bcdf commit 62b282f

File tree

19 files changed

+4711
-5647
lines changed

19 files changed

+4711
-5647
lines changed
Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
11
package software.solid.fluttervlcplayer.Enums;
22

33
public enum DataSourceType {
4-
5-
ASSET(0),
6-
NETWORK(1),
7-
FILE(2);
8-
9-
private int mType;
10-
11-
DataSourceType (int type)
12-
{
13-
this.mType = type;
14-
}
15-
16-
public int getNumericType() {
17-
return mType;
18-
}
19-
4+
ASSET,
5+
NETWORK,
6+
FILE;
207
}
Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
package software.solid.fluttervlcplayer.Enums;
22

33
public enum HwAcc {
4-
5-
AUTOMATIC(-1),
6-
DISABLED(0),
7-
DECODING(1),
8-
FULL(2);
9-
10-
private int mType;
11-
12-
HwAcc (int type)
13-
{
14-
this.mType = type;
15-
}
16-
17-
public int getNumericType() {
18-
return mType;
19-
}
4+
AUTOMATIC,
5+
DISABLED,
6+
DECODING,
7+
FULL;
208
}

flutter_vlc_player/android/src/main/java/software/solid/fluttervlcplayer/FlutterVlcPlayer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import android.view.SurfaceView;
1919
import android.view.View;
2020

21+
import androidx.annotation.Nullable;
22+
2123
import io.flutter.plugin.common.BinaryMessenger;
2224
import io.flutter.plugin.common.EventChannel;
2325
import io.flutter.plugin.platform.PlatformView;
@@ -633,10 +635,13 @@ void castToRenderer(String rendererDevice) {
633635
mediaPlayer.play();
634636
}
635637

638+
@Nullable
636639
String getSnapshot() {
637640
if (textureView == null) return "";
638641

639642
Bitmap bitmap = textureView.getBitmap();
643+
if (bitmap == null) return null;
644+
640645
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
641646
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
642647
return Base64.encodeToString(outputStream.toByteArray(), Base64.NO_WRAP);

0 commit comments

Comments
 (0)