added external player redirection

This commit is contained in:
Vologhat
2022-07-13 05:34:22 +03:00
parent bb73aaa580
commit cb122bb6c8
4 changed files with 30 additions and 1 deletions
@@ -29,10 +29,12 @@ public class ExternalLinkHandler{
);
private static final Map<String, String> qualities = new HashMap<>();
public static boolean parseVideoFile(VideoFile file, Context context){
public static boolean parseVideoFile(VideoFile file){
var context = getContext();
if (checkYoutubeLink(file)) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse(file.G));
context.startActivity(intent);
return true;
@@ -1427,6 +1427,15 @@
.method public static final a(Landroid/content/Context;Lcom/vk/dto/common/VideoFile;Ljava/lang/String;Lcom/vk/libvideo/ad/AdsDataProvider;Ljava/lang/String;Lcom/vk/statistic/Statistic;ZLcom/vk/common/links/OpenCallback;Ljava/lang/Integer;)V
.locals 14
invoke-static/range {p1 .. p1}, Lru/vtosters/lite/utils/ExternalLinkHandler;->parseVideoFile(Lcom/vk/dto/common/VideoFile;)Z
move-result v9
if-eqz v9, :cond_custom
return-void
:cond_custom
move-object v9, p0
move-object v1, p1
@@ -377,6 +377,15 @@
move-result-object v1
invoke-static/range {v1 .. v1}, Lru/vtosters/lite/utils/ExternalLinkHandler;->parseVideoFile(Lcom/vk/dto/common/VideoFile;)Z
move-result v4
if-eqz v4, :cond_custom
return-void
:cond_custom
const-string v2, "video"
.line 5
@@ -1320,6 +1320,15 @@
return-void
:cond_1
invoke-static/range {v2 .. v2}, Lru/vtosters/lite/utils/ExternalLinkHandler;->parseVideoFile(Lcom/vk/dto/common/VideoFile;)Z
move-result v3
if-eqz v3, :cond_custom
return-void
:cond_custom
if-eqz v1, :cond_2
.line 6