Added native PGS (graphical subtitle) rendering for external streams.
This commit is contained in:
@@ -48,6 +48,15 @@ function supportsTextTracks() {
|
||||
return _supportsTextTracks;
|
||||
}
|
||||
|
||||
let _supportsCanvas2D;
|
||||
function supportsCanvas2D() {
|
||||
if (_supportsCanvas2D == null) {
|
||||
_supportsCanvas2D = document.createElement('canvas').getContext('2d') != null;
|
||||
}
|
||||
|
||||
return _supportsCanvas2D;
|
||||
}
|
||||
|
||||
let _canPlayHls;
|
||||
function canPlayHls() {
|
||||
if (_canPlayHls == null) {
|
||||
@@ -1432,6 +1441,13 @@ export default function (options) {
|
||||
Method: 'External'
|
||||
});
|
||||
}
|
||||
|
||||
if (supportsCanvas2D()) {
|
||||
profile.SubtitleProfiles.push({
|
||||
Format: 'pgssub',
|
||||
Method: 'External'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
profile.ResponseProfiles = [];
|
||||
|
||||
Reference in New Issue
Block a user