Enable Media Preview V2.
This commit is contained in:
parent
3fefc17582
commit
7f4e964ec8
4 changed files with 5 additions and 21 deletions
|
@ -6,8 +6,6 @@ import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
import org.thoughtcrime.securesms.MediaPreviewActivity
|
|
||||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
|
||||||
|
|
||||||
object MediaIntentFactory {
|
object MediaIntentFactory {
|
||||||
private const val ARGS_KEY = "args"
|
private const val ARGS_KEY = "args"
|
||||||
|
@ -45,23 +43,6 @@ object MediaIntentFactory {
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun create(context: Context, args: MediaPreviewArgs): Intent {
|
fun create(context: Context, args: MediaPreviewArgs): Intent {
|
||||||
|
return Intent(context, MediaPreviewV2Activity::class.java).putExtra(ARGS_KEY, args)
|
||||||
return if (FeatureFlags.mediaPreviewV2()) {
|
|
||||||
val intent = Intent(context, MediaPreviewV2Activity::class.java)
|
|
||||||
intent.putExtra(ARGS_KEY, args)
|
|
||||||
return intent
|
|
||||||
} else {
|
|
||||||
val intent = Intent(context, MediaPreviewActivity::class.java).apply {
|
|
||||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
||||||
setDataAndType(args.initialMediaUri, args.initialMediaType)
|
|
||||||
putExtra(THREAD_ID_EXTRA, args.threadId)
|
|
||||||
putExtra(DATE_EXTRA, args.date)
|
|
||||||
putExtra(SIZE_EXTRA, args.initialMediaSize)
|
|
||||||
putExtra(CAPTION_EXTRA, args.initialCaption)
|
|
||||||
putExtra(IS_VIDEO_GIF, args.isVideoGif)
|
|
||||||
putExtra(LEFT_IS_RECENT_EXTRA, args.leftIsRecent)
|
|
||||||
}
|
|
||||||
return intent
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@ public final class VideoMediaPreviewFragment extends MediaPreviewFragment {
|
||||||
videoView.setPlayerCallback(new VideoPlayer.PlayerCallback() {
|
videoView.setPlayerCallback(new VideoPlayer.PlayerCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onReady() {
|
public void onReady() {
|
||||||
|
updateSkipButtonState();
|
||||||
events.onMediaReady();
|
events.onMediaReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,7 @@ public final class FeatureFlags {
|
||||||
RECIPIENT_MERGE_V2,
|
RECIPIENT_MERGE_V2,
|
||||||
STORIES,
|
STORIES,
|
||||||
SMS_EXPORT_MEGAPHONE_DELAY_DAYS,
|
SMS_EXPORT_MEGAPHONE_DELAY_DAYS,
|
||||||
MEDIA_PREVIEW_V2,
|
SMS_EXPORT_MEGAPHONE_DELAY_DAYS,
|
||||||
CREDIT_CARD_PAYMENTS
|
CREDIT_CARD_PAYMENTS
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
||||||
import org.thoughtcrime.securesms.net.ContentProxySelector
|
import org.thoughtcrime.securesms.net.ContentProxySelector
|
||||||
import org.thoughtcrime.securesms.util.AppForegroundObserver
|
import org.thoughtcrime.securesms.util.AppForegroundObserver
|
||||||
import org.thoughtcrime.securesms.util.DeviceProperties
|
import org.thoughtcrime.securesms.util.DeviceProperties
|
||||||
|
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||||
|
import kotlin.time.Duration.Companion.seconds
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ExoPlayerPool concrete instance which helps to manage a pool of SimpleExoPlayer objects
|
* ExoPlayerPool concrete instance which helps to manage a pool of SimpleExoPlayer objects
|
||||||
|
|
Loading…
Add table
Reference in a new issue