-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(player): add support for custom domain for
VideoOptions.fromURL
- Loading branch information
1 parent
d46a245
commit 8c73b87
Showing
5 changed files
with
132 additions
and
21 deletions.
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
16 changes: 16 additions & 0 deletions
16
player/src/main/java/video/api/player/extensions/URLExtensions.kt
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,16 @@ | ||
package video.api.player.extensions | ||
|
||
import video.api.player.models.VideoOptions | ||
import video.api.player.models.VideoType | ||
import video.api.player.utils.Utils | ||
import java.net.URL | ||
|
||
/** | ||
* Converts an api.video URL String to a [VideoOptions]. | ||
* | ||
* @return corresponding [VideoOptions] or an exception | ||
*/ | ||
fun URL.parseAsVideoOptions( | ||
vodDomainURL: URL = URL(VideoType.VOD.baseUrl), | ||
liveDomainURL: URL = URL(VideoType.LIVE.baseUrl) | ||
) = Utils.parseMediaUrl(this, vodDomainURL, liveDomainURL) |
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