mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-16 16:16:40 +03:00
fix: VTT Cue Parsing On PlayStation 4 (#4340)
Need to exclude PlayStation 4 from TextDecoder usage, because even if TextDecoder is defined, VTT cues are not properly parsed on that platform. Closes #4321
This commit is contained in:
@@ -11,6 +11,7 @@ goog.require('shaka.log');
|
||||
goog.require('shaka.util.BufferUtils');
|
||||
goog.require('shaka.util.Error');
|
||||
goog.require('shaka.util.Lazy');
|
||||
goog.require('shaka.util.Platform');
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,7 +37,7 @@ shaka.util.StringUtils = class {
|
||||
if (uint8[0] == 0xef && uint8[1] == 0xbb && uint8[2] == 0xbf) {
|
||||
uint8 = uint8.subarray(3);
|
||||
}
|
||||
if (window.TextDecoder) {
|
||||
if (window.TextDecoder && !shaka.util.Platform.isPS4()) {
|
||||
// Use the TextDecoder interface to decode the text. This has the
|
||||
// advantage compared to the previously-standard decodeUriComponent that
|
||||
// it will continue parsing even if it finds an invalid UTF8 character,
|
||||
@@ -160,7 +161,7 @@ shaka.util.StringUtils = class {
|
||||
* @export
|
||||
*/
|
||||
static toUTF8(str) {
|
||||
if (window.TextEncoder) {
|
||||
if (window.TextEncoder && !shaka.util.Platform.isPS4()) {
|
||||
const utf8Encoder = new TextEncoder();
|
||||
return shaka.util.BufferUtils.toArrayBuffer(utf8Encoder.encode(str));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user