forked from valtech-sd/react-native-video
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
4,038 additions
and
546 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
36 changes: 36 additions & 0 deletions
36
android/src/main/java/androidx/media3/exoplayer/dash/DashMediaSource.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 androidx.media3.exoplayer.dash; | ||
|
||
import androidx.media3.common.MediaItem; | ||
import androidx.media3.datasource.DataSource; | ||
import androidx.media3.exoplayer.drm.DrmSessionManagerProvider; | ||
import androidx.media3.exoplayer.source.MediaSource; | ||
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy; | ||
|
||
public class DashMediaSource { | ||
public static class Factory implements MediaSource.Factory { | ||
|
||
public Factory(DefaultDashChunkSource.Factory factory, DataSource.Factory factory1) { | ||
} | ||
|
||
@Override | ||
public MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int[] getSupportedTypes() { | ||
return new int[0]; | ||
} | ||
|
||
@Override | ||
public MediaSource createMediaSource(MediaItem mediaItem) { | ||
return null; | ||
} | ||
} | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
android/src/main/java/androidx/media3/exoplayer/dash/DefaultDashChunkSource.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 androidx.media3.exoplayer.dash; | ||
|
||
import androidx.media3.datasource.DataSource; | ||
|
||
public class DefaultDashChunkSource { | ||
public static final class Factory { | ||
public Factory(DataSource.Factory mediaDataSourceFactory) { | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
android/src/main/java/androidx/media3/exoplayer/hls/HlsMediaSource.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,38 @@ | ||
package androidx.media3.exoplayer.hls; | ||
|
||
import androidx.media3.common.MediaItem; | ||
import androidx.media3.datasource.DataSource; | ||
import androidx.media3.exoplayer.drm.DrmSessionManagerProvider; | ||
import androidx.media3.exoplayer.source.MediaSource; | ||
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy; | ||
|
||
public class HlsMediaSource { | ||
public static class Factory implements MediaSource.Factory { | ||
public Factory(DataSource.Factory mediaDataSourceFactory) { | ||
} | ||
|
||
@Override | ||
public MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int[] getSupportedTypes() { | ||
return new int[0]; | ||
} | ||
|
||
@Override | ||
public MediaSource createMediaSource(MediaItem mediaItem) { | ||
return null; | ||
} | ||
|
||
public Factory setAllowChunklessPreparation(boolean allowChunklessPreparation) { | ||
return this; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
android/src/main/java/androidx/media3/exoplayer/rtsp/RtspMediaSource.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,34 @@ | ||
package androidx.media3.exoplayer.rtsp; | ||
|
||
import androidx.media3.common.MediaItem; | ||
import androidx.media3.exoplayer.drm.DrmSessionManagerProvider; | ||
import androidx.media3.exoplayer.source.MediaSource; | ||
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy; | ||
|
||
public class RtspMediaSource { | ||
public RtspMediaSource() { | ||
|
||
} | ||
|
||
public static class Factory implements MediaSource.Factory { | ||
@Override | ||
public MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int[] getSupportedTypes() { | ||
return new int[0]; | ||
} | ||
|
||
@Override | ||
public MediaSource createMediaSource(MediaItem mediaItem) { | ||
return null; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
android/src/main/java/androidx/media3/exoplayer/smoothstreaming/DefaultSsChunkSource.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,34 @@ | ||
package androidx.media3.exoplayer.smoothstreaming; | ||
|
||
import androidx.media3.common.MediaItem; | ||
import androidx.media3.datasource.DataSource; | ||
import androidx.media3.exoplayer.drm.DrmSessionManagerProvider; | ||
import androidx.media3.exoplayer.source.MediaSource; | ||
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy; | ||
|
||
public class DefaultSsChunkSource { | ||
public static class Factory implements MediaSource.Factory { | ||
public Factory(DataSource.Factory mediaDataSourceFactory) { | ||
} | ||
|
||
@Override | ||
public MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int[] getSupportedTypes() { | ||
return new int[0]; | ||
} | ||
|
||
@Override | ||
public MediaSource createMediaSource(MediaItem mediaItem) { | ||
return null; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
android/src/main/java/androidx/media3/exoplayer/smoothstreaming/SsMediaSource.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,34 @@ | ||
package androidx.media3.exoplayer.smoothstreaming; | ||
|
||
import androidx.media3.common.MediaItem; | ||
import androidx.media3.datasource.DataSource; | ||
import androidx.media3.exoplayer.drm.DrmSessionManagerProvider; | ||
import androidx.media3.exoplayer.source.MediaSource; | ||
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy; | ||
|
||
public class SsMediaSource { | ||
public static class Factory implements MediaSource.Factory { | ||
public Factory(DefaultSsChunkSource.Factory factory, DataSource.Factory factory1) { | ||
} | ||
|
||
@Override | ||
public MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int[] getSupportedTypes() { | ||
return new int[0]; | ||
} | ||
|
||
@Override | ||
public MediaSource createMediaSource(MediaItem mediaItem) { | ||
return null; | ||
} | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
android/src/main/java/com/brentvatne/common/api/DRMProps.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,66 @@ | ||
package com.brentvatne.common.api | ||
|
||
import com.brentvatne.common.toolbox.ReactBridgeUtils.safeGetArray | ||
import com.brentvatne.common.toolbox.ReactBridgeUtils.safeGetString | ||
import com.facebook.react.bridge.ReadableMap | ||
import java.util.UUID | ||
|
||
/** | ||
* Class representing DRM props for host. | ||
* Only generic code here, no reference to the player. | ||
*/ | ||
class DRMProps { | ||
/** | ||
* string version of configured UUID for drm prop | ||
*/ | ||
var drmType: String? = null | ||
|
||
/** | ||
* Configured UUID for drm prop | ||
*/ | ||
var drmUUID: UUID? = null | ||
|
||
/** | ||
* DRM license server to be used | ||
*/ | ||
var drmLicenseServer: String? = null | ||
|
||
/** | ||
* DRM Http Header to access to license server | ||
*/ | ||
var drmLicenseHeader: Array<String> = emptyArray<String>() | ||
companion object { | ||
private const val PROP_DRM_TYPE = "type" | ||
private const val PROP_DRM_LICENSE_SERVER = "licenseServer" | ||
private const val PROP_DRM_HEADERS = "headers" | ||
private const val PROP_DRM_HEADERS_KEY = "key" | ||
private const val PROP_DRM_HEADERS_VALUE = "value" | ||
|
||
/** parse the source ReadableMap received from app */ | ||
@JvmStatic | ||
fun parse(src: ReadableMap?): DRMProps? { | ||
var drm: DRMProps? = null | ||
if (src != null && src.hasKey(PROP_DRM_TYPE)) { | ||
drm = DRMProps() | ||
drm.drmType = safeGetString(src, PROP_DRM_TYPE) | ||
drm.drmLicenseServer = safeGetString(src, PROP_DRM_LICENSE_SERVER) | ||
val drmHeadersArray = safeGetArray(src, PROP_DRM_HEADERS) | ||
if (drm.drmType != null && drm.drmLicenseServer != null) { | ||
if (drmHeadersArray != null) { | ||
val drmKeyRequestPropertiesList = ArrayList<String?>() | ||
for (i in 0 until drmHeadersArray.size()) { | ||
val current = drmHeadersArray.getMap(i) | ||
drmKeyRequestPropertiesList.add(safeGetString(current, PROP_DRM_HEADERS_KEY)) | ||
drmKeyRequestPropertiesList.add(safeGetString(current, PROP_DRM_HEADERS_VALUE)) | ||
} | ||
val array = emptyArray<String>() | ||
drm.drmLicenseHeader = drmKeyRequestPropertiesList.toArray(array) | ||
} | ||
} else { | ||
return null | ||
} | ||
} | ||
return drm | ||
} | ||
} | ||
} |
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.