mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-29 04:17:12 +01:00
Null check when fetching v.redd.it in ViewVideoActivity.
This commit is contained in:
parent
78deab34b7
commit
01304ee7dc
@ -553,20 +553,24 @@ public class ViewVideoActivity extends AppCompatActivity {
|
|||||||
loadGfycatOrRedgifsVideo(redgifsRetrofit, gfycatId, savedInstanceState, false);
|
loadGfycatOrRedgifsVideo(redgifsRetrofit, gfycatId, savedInstanceState, false);
|
||||||
} else {
|
} else {
|
||||||
progressBar.setVisibility(View.INVISIBLE);
|
progressBar.setVisibility(View.INVISIBLE);
|
||||||
mVideoUri = Uri.parse(post.getVideoUrl());
|
if (post.getVideoUrl() != null) {
|
||||||
subredditName = post.getSubredditName();
|
mVideoUri = Uri.parse(post.getVideoUrl());
|
||||||
id = post.getId();
|
subredditName = post.getSubredditName();
|
||||||
videoDownloadUrl = post.getVideoDownloadUrl();
|
id = post.getId();
|
||||||
|
videoDownloadUrl = post.getVideoDownloadUrl();
|
||||||
|
|
||||||
videoFileName = subredditName + "-" + id + ".mp4";
|
videoFileName = subredditName + "-" + id + ".mp4";
|
||||||
// Produces DataSource instances through which media data is loaded.
|
// Produces DataSource instances through which media data is loaded.
|
||||||
dataSourceFactory = new CacheDataSourceFactory(mSimpleCache,
|
dataSourceFactory = new CacheDataSourceFactory(mSimpleCache,
|
||||||
new DefaultHttpDataSourceFactory(
|
new DefaultHttpDataSourceFactory(
|
||||||
Util.getUserAgent(ViewVideoActivity.this,
|
Util.getUserAgent(ViewVideoActivity.this,
|
||||||
"Infinity")));
|
"Infinity")));
|
||||||
// Prepare the player with the source.
|
// Prepare the player with the source.
|
||||||
player.prepare(new HlsMediaSource.Factory(dataSourceFactory).createMediaSource(mVideoUri));
|
player.prepare(new HlsMediaSource.Factory(dataSourceFactory).createMediaSource(mVideoUri));
|
||||||
preparePlayer(savedInstanceState);
|
preparePlayer(savedInstanceState);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(ViewVideoActivity.this, R.string.error_fetching_v_redd_it_video_cannot_get_video_url, Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1114,6 +1114,7 @@
|
|||||||
<string name="error_fetching_v_redd_it_video_cannot_get_redirect_url">Error fetching v.redd.it video: Cannot get the redirect url</string>
|
<string name="error_fetching_v_redd_it_video_cannot_get_redirect_url">Error fetching v.redd.it video: Cannot get the redirect url</string>
|
||||||
<string name="error_fetching_v_redd_it_video_cannot_get_post">Error fetching v.redd.it video: Cannot get the post</string>
|
<string name="error_fetching_v_redd_it_video_cannot_get_post">Error fetching v.redd.it video: Cannot get the post</string>
|
||||||
<string name="error_fetching_v_redd_it_video_cannot_get_post_id">Error fetching v.redd.it video: Cannot get the post id</string>
|
<string name="error_fetching_v_redd_it_video_cannot_get_post_id">Error fetching v.redd.it video: Cannot get the post id</string>
|
||||||
|
<string name="error_fetching_v_redd_it_video_cannot_get_video_url">Error fetching v.redd.it video: Cannot get the video url</string>
|
||||||
|
|
||||||
<string name="always_on">Always On</string>
|
<string name="always_on">Always On</string>
|
||||||
<string name="only_on_wifi">Only on Wifi</string>
|
<string name="only_on_wifi">Only on Wifi</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user