Commit Graph

201 Commits

Author SHA1 Message Date
Armands Malejevs
da1d3bb6c3 Retru on session exceptions 2022-05-24 10:36:49 +03:00
Armands Malejev
c193fe873e
VEX-7095: Crash in ReactExoplayerView.java Line 1059 (#31)
Prevent crashing when the track selector is null.
2022-05-09 17:53:09 -04:00
Armands Malejev
c584022d34
VEX-7094: Android: Crash in ReactExoplayerView.java Line 694 (#30)
When moving init logic to a different thread we missed one function that was not captured if an error occurred. This PR wraps the source init function that happens on a different thread in a try/catch to capture any errors that occur.
2022-05-05 17:10:55 -04:00
Gabriel Rivero
9035e7dfc9
VEX-6625: Handle state to keep playing after gaining connection (#28)
This PR handles autoplay after disconnection

Jira: VEX-6625

There was an error in react-native-video not being properly handled, in addition, the state of the player when reconnecting using a free user was not the expected one, requesting the player to keep playing when ready, made the behavior consistent in all scenarios

Velocity PR: crunchyroll/velocity#2430

Reviews
Major reviewer (domain expert): @jctorresM
Minor reviewer: @jacob-livingston
2022-05-03 16:43:53 -04:00
Gabriel Rivero
b274541431
VEX-7093: Protect initialization of DRM (#29)
This PR will fix the crash from the experiment on react-native-video

Jira: VEX-7093

velocity PR: crunchyroll/velocity#2443

The crash was caused by using the player object before it was set by another thread, the change simply waits for the player to be available before executing any player interaction after DRM initialization.

Reviews
Major reviewer (domain expert): @jctorresM
Minor reviewer: @jacob-livingston
2022-04-28 20:17:59 -04:00
Armands Malejev
f6e9cc8502
VEX-6891: Android: Infinite loading when closing & reopening the player on low end devices (#27)
On low end devices when replaying same content too quickly DRM could fail with an uncaptured error (DrmSessionException). To prevent this we now check for that error and retry DRM one more time.
2022-04-25 19:44:37 -04:00
Armands Malejev
6815044013
VEX-6099: Android: Progress knob jumps backward after tapping Skip Forwards multiple times (#26)
Move to the new way of detecting seek end and remove onSeekProcessed which was deprecated.
2022-04-19 20:05:32 -04:00
Gabriel Rivero
03f77495fc
VEX-6350: add onPlaybackStateChanged prop (#25)
* Adds the new prop onPlaybackStateChanged
2022-04-19 12:12:47 -04:00
Armands Malejev
f78c623df4
VEX-6779: React Native Video buildDrmSessionManager crash followup (#24)
Fix infinite loading on some devices caused by earlier fix to drm session manager crash
2022-04-07 12:36:50 -04:00
Gabriel Rivero
4d17096630
VEX-6779: React Native Video buildDrmSessionManager crash (#23)
Move DRM initialization logic into a separate thread to prevent ANRs.
2022-04-05 18:19:43 -04:00
Armands Malejev
e39d87edae
VEX-6778: Android: React Native video getVideoTrackInfoFromManifest crash (#20)
JIRA: VEX-6778

Move video track info request logic entirely on a different thread, completely preventing ANRs in this section of code.
2022-03-31 15:37:53 +03:00
Armands Malejevs
0e3fe11b78 Fix runtime issues 2022-03-30 15:33:17 +03:00
Armands Malejevs
edd3cc1698 Fix runtime issues 2022-03-30 15:27:09 +03:00
Armands Malejevs
bd1f7f50cb Fix runtime issues 2022-03-30 15:19:50 +03:00
Armands Malejevs
7067afa609 Fix runtime crash 2022-03-30 15:04:49 +03:00
Armands Malejevs
cca2744542 Fix typo 2022-03-30 14:49:40 +03:00
Armands Malejevs
142521bc0e Fix build issues 2022-03-30 14:43:04 +03:00
Armands Malejevs
2f77765fe2 Clean up 2022-03-30 14:35:48 +03:00
Armands Malejevs
88f32ae3c8 Move DRM init to a separate thread 2022-03-30 14:29:08 +03:00
Nick Fujita
39dee21efa
Updates disableDisconnectError retry condition to be more specific (#22)
Updates disableDisconnectError retry condition to be more specific.

Jira: VEX-6518

Reviews
Major reviewer (domain expert): @armadilio3
Minor reviewer: @gabriel-rivero
2022-03-30 18:17:56 +09:00
Armands Malejevs
b6f3652636 Capture more errors from DRM session manager 2022-03-29 15:21:39 +03:00
Gabriel
2af360a7bb add useSecureView prop to prevent screen recording 2022-02-14 21:17:22 -04:00
Armands Malejev
2ab029995f
VEX-6365: Improve memory management (#17)
Improve memory management to reduce pressure on low end devices.

JIRA: VEX-6365
2022-01-21 14:10:22 +02:00
Gabriel Rivero
ab202c96b6 typo 2021-11-16 21:40:38 -04:00
Gabriel Rivero
2b310cbf7e force garbage collector when free memory reaches 0 2021-11-16 20:35:30 -04:00
Gabriel Rivero
292b53916a
VEX-6030: Reduce buffer size based on heap (#13)
This PR changes the behavior on old devices that have poor memory management.

Jira: VEX-6030
https://jira.tenkasu.net/browse/VEX-6030

The solution implied customizing the method shouldContinueLoading from RNVLoadControl to use only the available heap, performing tests on an old Nexus 5 it was determined the ideal bytes allocation to half the reported heap, that provided some buffering during ads but smooth playback during the video with no crashes (23:39 of 23:39 at the moment of writing this, video kept playing as expected after 3 ad breaks)

The fix is only targeting Marshmallow as the reduction of buffer is substantial and other versions that work properly should not get affected.

Depending on the test result of VEX-5758, this same fix can be applied to Nougat

Reviews
Major reviewer (domain expert): @armadilio3
Minor reviewer: @nickfujita
2021-11-09 14:37:52 -04:00
Armands Malejev
f712eecb4f
VEX-6011: Align AVOD resolutions with available resolutions on Content (#14)
Add support for content tracks and improve track selection to work even during ads playback.
2021-11-09 14:22:32 +02:00
Gabriel Rivero
7dbc5eb078 add config parameter maxHeapAllocationPercent 2021-11-04 13:54:43 -04:00
Gabriel Rivero
40e450b0b1 VEX-6030-reduce-buffer-size-based-on-heap 2021-11-03 19:35:27 -04:00
Gabriel Rivero
0ab7ff476b VEX-6030-reduce-buffer-size-based-on-heap 2021-11-03 19:14:19 -04:00
Armands Malejev
3bcf2c6061
VEX-5798: Implement DRM L1 to L3 fallback (#9)
Add support for L1 to L3 Widevine fallback if playback fails initially.
2021-10-13 18:03:29 +03:00
Armands Malejev
2fcc1de626
VEX-5825: Android player error handling improvements (#10)
Improve error handling.
2021-10-12 14:56:50 +03:00
Armands Malejev
a0b679cc07
VEX-5545: Some Android codecs don't support specific resolutions (#8)
Add support for detecting if format is supported and exclude unsupported resolutions from auto quality selection and video track info in RN.
2021-09-26 16:38:10 +03:00
Armands Malejev
93604b2c25
VEX-3245: Buffer Progress UI While Paused (#7)
Add support for onBufferProgress prop on Android to get buffer data even when the player is paused.
2021-07-07 18:59:55 +03:00
Nick Fujita
cba88fa9d8
VEX-5044: Allow exoplayer to preinit with empty source (#6)
- Allow player to be init before source is provided, and later update once a source is provided.
- Adds handling for providing a empty source in order to stop playback and clear out any existing content
2021-06-30 10:24:21 +09:00
Armands Malejev
80873102a4
VEX-4579: Network loss handling (#5)
Add support for customizing back buffer duration and handle network errors gracefully to prevent releasing the player when network is lost.
2021-05-17 13:09:09 +03:00
Armands Malejev
f6cce0d819
VEX-4556: The app crashes when the premium episode is loaded (#4)
Fix player crashing when it is being cleared.
2021-05-07 11:37:57 +03:00
Adrian Mui
61e6535b2f
Feature/toggle buffering (#3)
This PR adds the property disableBuffering: boolean for android. The PR was initally created as a personal fork and referenced in crunchyroll/vilos#1227

also updated RNVLoadControl constructor and method to reflect new ExoPlayer.LoadControl api

related ticket: https://jira.tenkasu.net/browse/VEX-3776
2021-03-18 12:58:04 +02:00
Armands Malejev
6100981760
Upgrade exoplayer to 2.13.2 (#2)
Upgrade ExoPlayer from 2.11.4 to 2.13.2 and fix any related issues related to the upgrade and deprecated method use.
2021-03-17 17:49:10 +02:00
Armands Malejev
568971be77
Fix AudoFocus pausing video when attempting to play (#1)
Fix AudioFocus bug that could cause the player to stop responding to play/pause in some instances.

Fixes issue react-native-video#1945

This was caused by the player requesting audio focus on each play (un-pause) and that resulted in a small window of Audio focus loss and then gain. The focus loss results in the player being paused while the player was supposed to play at the time. The solution is to keep track of Audio focus and not request new focus if we already have it.
2021-03-15 16:51:16 +02:00
Nick Fujita
553fef02cc Port over fix from 4.x branch 2020-08-17 16:28:36 +09:00
Daniel Mariño
81b42e7ca7
Add iOS and Android basic DRM support (#1445)
This PR adds support for DRM streams on iOS (Fairplay) and Android (Playready, Widevine, Clearkey)

I am neither Android nor iOS developer, so feel free to provide feedback to improve this PR.

**Test stream for ANDROID:**
```
testStream = {
        uri: 'http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)',
        type: 'mpd',
        drm: {
            type: DRMType.PLAYREADY,
            licenseServer: 'http://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:150)'
        }
    };
```

or 
```
{
    uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd',
    drm: {
        type: 'widevine', //or DRMType.WIDEVINE
        licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
        headers: {
            'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU'
        },
    }
}
```

**Test stream for iOS:**
Sorry but I can not provide free streams to test. If anyone can provide test streams, or found some we can use, please let me know to also test them.

It has been tested with a private provider and they work, at least with the `getLicense` override method. (An example implementation is provided in the README)
2020-08-12 18:56:21 -07:00
Jeferson Daniel
dbf1a4e034
Fix exoplayer aspect ratio update on source changes (#2053)
* Fix exoplayer aspect ratio update on source changes

* Update CHANGELOG.md
2020-06-30 19:00:16 +02:00
Anders Lemke
8962720f56
Support preventsDisplaySleepDuringVideoPlayback (#2019)
* Add flag on iOS

* Add flag in Android

* Add documentation

* Add changelog entry

* Also set setKeepScreenOn

* Fix prop not being set

* add preventsDisplaySleepDuringVideoPlayback to exoplayer

* Update android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java

* Update android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java

Co-authored-by: Jens Andersson <jens@fritan.com>

Co-authored-by: Anton Tanderup <antontandrup@gmail.com>
Co-authored-by: Jens Andersson <jens@fritan.com>
2020-06-16 14:31:23 +02:00
Jens Andersson
f395bd1d3d
Removed JS fullscreening for Android (#2013) 2020-06-11 16:44:13 +02:00
limaAniceto
7c8c613a65
Upgrade exoplayer to 2.11.4 (#2034) 2020-06-11 09:17:33 -04:00
Param Aggarwal
0b914ef2b9
Expose currentPlaybackTime when live stream video (#1944)
* added trackId to exoplayer onLoad callback

* added trackInfo to bandwidth callback

* syntax fix

* syntax fix

* version update

* sending complete logcat for media playback exception ExoPlaybackException

* version bump

* package publish changes

* Live playback fix

* Version bump

* import fix

* version bump

* configurable preferredForwardBufferDuration

* configurable preferredForwardBufferDuration

* version update

* Exposing time

* exo player window current tsp

* return type

* Current window timestamp in epoch

* iOS changes

* version update

* Updated package.json

* updated version

* CurrentTime bug fix

* Updated package.json

* Updated currentPlaybackTime

* Updated currentPlayback logic

* Updated package.json

* Bug fix

* Added semicolon

* updated package.json

* Updated ReactVideoView

* updated verison

* Revert package.json changes

* Update ReactVideoView.java

* Use standard log

* Document preferredForwardBufferDuration (iOS)

* Document currentPlaybackTime

* Document trackId

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update README.md

* Update CHANGELOG.md

Co-authored-by: anubansal <anu.bansal@curefit.com>
Co-authored-by: Sivakumar J <sivakumar@curefit.com>
Co-authored-by: parikshit <parikshit@curefit.com>
Co-authored-by: anubansal92 <40559524+anubansal92@users.noreply.github.com>
Co-authored-by: Rishu Agrawal <rishu.agrawal@v.curefit.com>
Co-authored-by: rishu-curefit <54575330+rishu-curefit@users.noreply.github.com>
2020-05-15 09:25:19 +02:00
IbrahimSulai
fd8ac76e4d
Fix play/pause regression after added fullscreen support. (#1916) 2020-02-20 09:23:23 -05:00
Michael Tintiuc
82c191d97f
Improve Android Audio Focus (#1897)
Implement audio focus as per android docs:
https://developer.android.com/guide/topics/media-apps/audio-focus
https://medium.com/androiddevelopers/audio-focus-3-cdc09da9c122

AUDIOFOCUS_LOSS should abandon focus and not try resuming audio, this is done with AUDIOFOCUS_LOSS_TRANSIENT

This fixes at least:
- Audio not being paused after focus being taken by some voip applications
- Content resuming and pausing instantly sporadically (some race condition perhaps) when activity was resumed from background.
2020-02-17 11:53:56 -05:00
IbrahimSulai
9200dce1ae
Add full screen support to Android Exoplayer (#1730) 2020-01-28 17:21:21 -05:00