This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
ALL-3936/Package restructure #55
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8a04fe6
Move exo-player specific files from noplayer.drm to exoplayer.drm, an…
7a075d7
Rescope and move classes in exo-player.forwarders where necessary.
7dd769b
Rescope and move classes in no-player where necessary.
771e011
Rescope and move classes in mediaPlayer.forwarders where necessary.
e4840b0
Rescope and move classes in mediaPlayer where necessary.
e290369
Rescope and move models to their own package.
e32b839
Merge branch 'ALL-3936/ensure_target_api' into ALL-3936/package_struc…
6b400cf
Rename and move ErrorFactory to ErrorMapper.
d8005c5
Rename HttpPoster to expose implementation.
3916278
Stop exposing the ProvisionExecutor.
b8c34f6
Merge branch 'ALL-3936/ensure_target_api' into ALL-3936/package_struc…
9b57560
Move SessionId and KeySetId to more appropriate packages.
9252a5d
Remove Impl from ProvisionExecutor.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
core/src/main/java/com/novoda/noplayer/drm/DownloadedModularDrm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
core/src/main/java/com/novoda/noplayer/drm/provision/ProvisionExecutorCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.novoda.noplayer.drm.provision; | ||
|
||
public class ProvisionExecutorCreator { | ||
|
||
public ProvisionExecutor create() { | ||
HttpUrlConnectionPoster httpPoster = new HttpUrlConnectionPoster(); | ||
ProvisioningCapabilities capabilities = ProvisioningCapabilities.newInstance(); | ||
return new ProvisionExecutorImpl(httpPoster, capabilities); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
core/src/main/java/com/novoda/noplayer/drm/provision/ProvisionExecutorImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.novoda.noplayer.drm.provision; | ||
|
||
import com.novoda.noplayer.drm.ModularDrmProvisionRequest; | ||
|
||
import java.io.IOException; | ||
import java.nio.charset.Charset; | ||
|
||
class ProvisionExecutorImpl implements ProvisionExecutor { | ||
|
||
private static final String PARAMETER_SIGNED_REQUEST = "&signedRequest="; | ||
|
||
private final HttpUrlConnectionPoster httpPoster; | ||
private final ProvisioningCapabilities capabilities; | ||
|
||
ProvisionExecutorImpl(HttpUrlConnectionPoster httpPoster, ProvisioningCapabilities capabilities) { | ||
this.httpPoster = httpPoster; | ||
this.capabilities = capabilities; | ||
} | ||
|
||
@Override | ||
public byte[] execute(ModularDrmProvisionRequest request) throws IOException, UnableToProvisionException { | ||
if (isIncapableOfProvisioning()) { | ||
throw new UnableToProvisionException(); | ||
} | ||
String provisioningUrl = buildProvisioningUrl(request); | ||
return httpPoster.post(provisioningUrl); | ||
} | ||
|
||
private boolean isIncapableOfProvisioning() { | ||
return !capabilities.canProvision(); | ||
} | ||
|
||
private String buildProvisioningUrl(ModularDrmProvisionRequest request) { | ||
return request.url() + PARAMETER_SIGNED_REQUEST + new String(request.data(), Charset.forName("UTF-8")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...player/drm/DownloadDrmSessionCreator.java → ...player/drm/DownloadDrmSessionCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we call this something that doesn't end in
impl
?HttpPostingProvisionExecutor
or something maybe?