Comments (2)
Hi,
We worked a lot on "end detection" since the v3.2.0
release.
The previous behavior of the player was to stop around 500ms before the true end of the content to avoid such cases.
However, as our company's needs grew, we wanted to be frame-accurate even at the end of the content, so we had to detect the true end of the content before stopping it.
We found some issue with this code which were fixed in v3.3.1
.
However there is no more issue with it we know of now, can we test the content you're playing to perform further investigations?
Thanks,
from rx-player.
Notes for those who might read this issue:
We continued to investigate this issue through e-mail exchanges and found out that it was linked to an old version of Chrome (Chrome 54).
As our goal is to support multiple platforms, which often include old versions of embedded Chromes, we try to work around this browser bug directly in our code.
The technical issue is that Chrome does not emit any "ended" event when it reaches the end, despite us calling mediaSource.endOfStream()
at the right time before that.
The resolution found was simply to check if we are at the end of the content when the player begins to stall.
We basically do (we do not actually have this code here, but we have the same principles):
/**
* Returns true if the content has ended.
* @param {HTMLMediaElement} videoElement
* @param {boolean} isStalled
* @returns {boolean}
*/
function hasEnded(videoElement, isStalled) {
if (videoElement.ended) {
return true;
}
if (isStalled) {
return Math.abs(videoElement.duration - videoElement.currentTime) < SOME_THRESHOLD;
}
return false;
}
/**
* Callback triggered when the content stalls.
*/
function whenStalled() {
if (hasEnded(videoElement, true)) {
console.log("The content has ended");
}
}
For now, that threshold is in the order of 1 ms. It can be updated in the config (FORCED_ENDED_THRESHOLD
in src/config.ts
). This logic can also be deactivated by setting this threshold to null
.
We're currently doing multiple regression tests to see if we can integrate this fix in the next release - v3.3.2
.
from rx-player.
Related Issues (20)
- Expose text adaptation's role HOT 4
- Support in-manifest LAURL for ClearKey HOT 4
- Streams media error on Edge HOT 4
- Segment GCed multiple times in a row warnings using DASH/PlayReady on Vestel MB211 HOT 6
- DISCONTINUITY_ENCOUNTERED errors after consecutive audio track switches, for DASH live content, result in an endless loop HOT 2
- KEY_GENERATE_REQUEST_ERROR - The initDataType parameter is empty (observed on Tizen 2017) HOT 7
- Video playback issues on Android Mobile in Chrome HOT 9
- Check Dolby Atmos and Dolby Vision in current stream HOT 3
- Unable to play some streams in Edge browser on RxPlayer v3.30.0 HOT 11
- Streams freeze on first frame with audio only playback on Edge browser (and probably Chrome) HOT 6
- Safari 17 brings MSE to iOS HOT 10
- Some DASH/Widevine streams are looping on a Vestel MB130 HOT 3
- First playback of PlayReady content fails on EDGE browsers HOT 3
- PIPELINE_ERROR_DECODE error observed in Edge browser when zapping live channels HOT 2
- Safari 17.1 issue with playback DRM content HOT 3
- playing MKV VOD with multi Audio track HOT 7
- Infinity loading state on Safari Mobile when autoplay is false HOT 17
- Arrêt brutal du player en Replay sur le mycanal sur HOT 4
- PIPELINE_ERROR_INVALID_STATE error when using Playready/Dash stream (mixed encrypted/unecrypted content) HOT 3
- fromFirstPosition does not start from actual first position in live DASH manifest (multi period live with SSAI) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rx-player.