Skip to content

Commit

Permalink
Merge branch 'master' into FEC-13946
Browse files Browse the repository at this point in the history
  • Loading branch information
SivanA-Kaltura committed Jun 20, 2024
2 parents c09ff53 + 16e2d47 commit b242747
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### 0.84.9 (2024-06-02)

### 0.84.8 (2024-04-09)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@playkit-js/playkit-js",
"version": "0.84.8",
"version": "0.84.9",
"keywords": [
"kaltura",
"player",
Expand Down
2 changes: 1 addition & 1 deletion src/engines/html5/html5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ export default class Html5 extends FakeEventTarget implements IEngine {
// Currently it's supported in chrome and in safari. So if we consider checking support before,
// we can use this flag to distinguish between the two. In the future we might need a different method.
// Second condition is because flow does not support this API yet
if (document.pictureInPictureEnabled && typeof this._el.requestPictureInPicture === 'function') {
if (document.pictureInPictureEnabled && typeof this._el.requestPictureInPicture === 'function' && !this._el.disablePictureInPicture) {
this._el.requestPictureInPicture().catch((error) => {
this.dispatchEvent(new FakeEvent(Html5EventType.ERROR, new Error(Error.Severity.RECOVERABLE, Error.Category.PLAYER, Error.Code.ENTER_PICTURE_IN_PICTURE_FAILED, error)));
});
Expand Down
33 changes: 18 additions & 15 deletions src/track/text-track-display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,13 +635,14 @@ class CueStyleBox extends StyleBox {
styles.unicodeBidi = 'plaintext';
}
this.applyStyles(styles, this.cueDiv);
const useDefaultAlignment = styleOptions.textAlign === 'default';

// Create an absolutely positioned div that will be used to position the cue
// div. Note, all WebVTT cue-setting alignments are equivalent to the CSS
// mirrors of them except "middle" which is "center" in CSS.
this.div = window.document.createElement('div');
let textAlign = cue.align === 'middle' ? 'center' : cue.align;
if (styleOptions.textAlign !== 'default') {
if (!useDefaultAlignment) {
textAlign = styleOptions.textAlign;
}
styles = {
Expand All @@ -664,20 +665,22 @@ class CueStyleBox extends StyleBox {
// position of the cue box. The reference edge will be resolved later when
// the box orientation styles are applied.
let textPos = 0;
switch (styleOptions.textAlign) {
case 'start':
case 'left':
case 'line-left':
textPos = cue.position;
break;
case 'center':
textPos = cue.position - cue.size / 2;
break;
case 'end':
case 'right':
case 'line-right':
textPos = cue.position - cue.size;
break;
if (useDefaultAlignment) {
switch (styleOptions.textAlign) {
case 'start':
case 'left':
case 'line-left':
textPos = cue.position;
break;
case 'center':
textPos = cue.position - cue.size / 2;
break;
case 'end':
case 'right':
case 'line-right':
textPos = cue.position - cue.size;
break;
}
}

// Horizontal box orientation; textPos is the distance from the left edge of the
Expand Down

0 comments on commit b242747

Please sign in to comment.