-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow video url redirects #66
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
@@ -44,7 +43,7 @@ public void onCreate(final @Nullable Bundle savedInstanceState) { | |||
setContentView(R.layout.video_player_layout); | |||
ButterKnife.bind(this); | |||
|
|||
viewModel.outputs.video() | |||
viewModel.outputs.preparePlayerWithUrl() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
muuuuch better name
this.startViewPledgeActivity = currentProject.compose(takeWhen(this.viewPledgeButtonClicked)); | ||
|
||
this.shareButtonClicked | ||
.compose(bindToLifecycle()) | ||
.subscribe(__ -> this.koala.trackShowProjectShareSheet()); | ||
|
||
this.playVideo | ||
this.startVideoActivity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
muuuuuch better name
|
||
interface Outputs { | ||
/** Emits the video for the player. */ | ||
Observable<String> preparePlayerWithUrl(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looooovin these new modern vm's
@@ -51,7 +51,7 @@ public KSRendererBuilder(final @NonNull Context context, final @NonNull String v | |||
@Override | |||
public void buildRenderers(final @NonNull KSVideoPlayer player) { | |||
final Allocator allocator = new DefaultAllocator(BUFFER_SEGMENT_SIZE); | |||
final DataSource dataSource = new DefaultUriDataSource(context, videoLink); | |||
final DataSource dataSource = new DefaultUriDataSource(context, null, videoLink, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this is the flag that allows redirects?
def makes you miss swift's named arguments when reading this code......
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
what
Video playback has been broken on our HQ environments with a 302 redirect error since our HQ video urls redirect.
Luckily the fix is nice: ExoPlayer has multiple constructors for
DefaultUriDataSource
(which we use in ourKSRendererBuilder
) one of which allows us to set a boolean forallowCrossProtocolRedirects
. You go ExoPlayer.Bonus modernization of our #weird
VideoViewModel
and refactoring of ourProjectViewModel
and tests.