Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1277 - Bug fix: Kaltura video player has various issues #1282

Open
wants to merge 511 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
511 commits
Select commit Hold shift + click to select a range
f685cf8
Add node title to make upload log more readable
zifgu Jun 21, 2022
19d6cba
Add comments and input validation
zifgu Jun 22, 2022
00b0093
Update comments for clarity
zifgu Jun 22, 2022
966645e
Add message asking user to refresh once upload is done
zifgu Jun 22, 2022
6a5110a
Remove unnecessary node set
legendword Jun 22, 2022
9c9b513
Fix check for local video
zifgu Jun 27, 2022
37c251a
Add cases for remaining statuses to prevent infinite loop
zifgu Jun 27, 2022
92956c5
Remove error_logs
zifgu Jun 27, 2022
504db1b
Update kaltura data of node during upload
zifgu Jun 28, 2022
153e657
Vertically align table headings at the top
zifgu Jun 28, 2022
df0cce3
Refactor upload code and save upload status in node kalturaData
zifgu Jun 28, 2022
b72fd36
Add cleanup button to WP admin dashboard
zifgu Jun 28, 2022
ceaf778
Uncomment code
zifgu Jun 28, 2022
e370c3e
Use JavaScript to show cleaned videos instead
zifgu Jun 28, 2022
c3c22ed
Update upload log after cleaning videos
zifgu Jun 28, 2022
53b1621
Remove a stray todo
zifgu Jun 28, 2022
98322fd
Fix error logs; add check for kaltura id; delete console log
zifgu Jun 29, 2022
ecd3f13
Do not save partnerId to kalturaData
zifgu Jun 29, 2022
c53ed64
Move upload in progress notice to Kaltura section
zifgu Jun 29, 2022
380b19a
Delete unused class; create custom CSS class
zifgu Jun 29, 2022
dd8ebf1
Move upload code to endpoints.php
zifgu Jun 29, 2022
7cc1c19
Add handler to mark upload as not in progress after fatal error and n…
zifgu Jun 29, 2022
adb75c3
Always mark upload as not in progress when script ends
zifgu Jun 29, 2022
2761d0b
Add settings button to force reset upload status
zifgu Jun 29, 2022
7e9c758
Merge branch 'master' into 1051-upload-video-to-kaltura
wynnset Jul 1, 2022
4eedef1
Dev improvement: Change DEV mode to be activated from wp-config
wynnset Jul 1, 2022
4407f01
Merge branch 'master' into 1051-upload-video-to-kaltura
wynnset Jul 1, 2022
93bca8e
Dev improvements:
wynnset Jul 1, 2022
6a21f63
Merge branch 'master' into 1051-upload-video-to-kaltura
wynnset Jul 1, 2022
35b16f5
Update README.md
wynnset Jul 1, 2022
acd7596
Merge branch 'master' into 1051-upload-video-to-kaltura
wynnset Jul 1, 2022
3738d7b
Merge branch '1051-upload-video-to-kaltura' into 1109-add-kaltura-pla…
wynnset Jul 1, 2022
9d98717
fix
wynnset Jul 1, 2022
64a8ef6
Merge branch '1051-upload-video-to-kaltura' into 1109-add-kaltura-pla…
wynnset Jul 1, 2022
ca2217a
Merge branch '1109-add-kaltura-player-integration' into 1168-kaltura-…
wynnset Jul 12, 2022
90942f5
Fix Kaltura video being set to mp4 media format
langara2020sz Jul 13, 2022
de63037
Add file size limit to Kaltura upload
zifgu Jul 26, 2022
65c89e4
Add caption editor, add captions to video player, add ability to set …
zifgu Jul 26, 2022
46e72c4
Lint files
zifgu Jul 26, 2022
68328d0
Add ability to keep pending captions
zifgu Jul 27, 2022
841347a
Persist old pending captions
zifgu Jul 27, 2022
44a255b
Fix forms not updating; fix bugged radio buttons
zifgu Jul 27, 2022
463d922
Add error message to pending captions explaining what error occurred
zifgu Jul 27, 2022
a53a168
Add warning to Kaltura dashboard if any captions failed to upload
zifgu Jul 27, 2022
eaf5a6d
Fix default caption not being checked; fix pending captions not using…
zifgu Jul 28, 2022
757cc27
Fix failing test by mocking Kaltura API calls (possibly temporarily)
zifgu Jul 28, 2022
1ed3437
Fix failing test because video URL input covered by error banner
zifgu Jul 28, 2022
9bcace5
Change Jest test to check new text
zifgu Jul 28, 2022
5fc6043
Use language as label if language is not recognized
zifgu Aug 2, 2022
ca6c900
Redesign caption UI; combine ISO 639-1 and Kaltura languages, making …
zifgu Aug 2, 2022
5191ae4
Clean up todos and add comments
zifgu Aug 2, 2022
cd5c67c
Remove filtering for ready captions only
zifgu Aug 3, 2022
3edaccd
Lint files
zifgu Aug 3, 2022
b4aa645
Add comment explaining the need for custom comparison
zifgu Aug 3, 2022
989a6ce
Add test for adding captions
zifgu Aug 3, 2022
d61f330
Remove mocks from test adding a Kaltura video
zifgu Aug 8, 2022
9cf23cc
Add accessible labels to Kaltura form
zifgu Aug 9, 2022
6db4a76
Fix failing test by waiting for Kaltura data to arrive
zifgu Aug 9, 2022
aa91c05
Mock getKalturaAvailableLanguages call to fix failing test
zifgu Aug 9, 2022
40059c3
Clean up code and add comments
zifgu Aug 9, 2022
de0ce24
Add more comments to code that processes Kaltura multirequests
zifgu Aug 9, 2022
3539cb3
Make captions collapsible; focus title of newest caption when added
zifgu Aug 9, 2022
d4d5c15
Fix failing test by using test video ID on new Kaltura account
zifgu Aug 10, 2022
083aae1
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 10, 2022
0788c23
Fix typo in constant name in max file size check
zifgu Aug 15, 2022
6e37039
Fix early return when using customCompareProps
zifgu Aug 15, 2022
609c573
Remove data-testid from changes to FileUpload
zifgu Aug 15, 2022
9256e86
Address refactorings
zifgu Aug 15, 2022
9e03572
Use .splice to delete captions and pending captions
zifgu Aug 15, 2022
e788acc
Change useCaptions to computed property
zifgu Aug 15, 2022
199c82a
Change captions and pendingCaptions to computed properties
zifgu Aug 15, 2022
4b7549e
Move VideoForm and CaptionRow to separate folder
zifgu Aug 15, 2022
bf6f3ac
Bug fix: error when re-submitting automatic captions created by Kaltura
zifgu Aug 16, 2022
01ce3c1
Bug fix: could have multiple pending captions with the same ID
zifgu Aug 16, 2022
63ae880
Add "display on player" field to captions
zifgu Aug 16, 2022
4ff6c4b
Fix test; copy captions array to trigger update
zifgu Aug 16, 2022
dbd70d4
Add support for SRT captions on Kaltura videos only
zifgu Aug 16, 2022
27b27ad
Bug fix: token ID still being reused between loops
zifgu Aug 16, 2022
464d17a
Bug fix: local uploads not detected on sites with month and year base…
zifgu Aug 16, 2022
83a26a0
From #1232: fix wrong video path; preserve Kaltura ID and media URL w…
zifgu Aug 16, 2022
58a12f5
From #1232: save partner ID and unique config to show Kaltura player
zifgu Aug 17, 2022
6ccded0
From #1232: Fix failing test because kalturaData property not assigned
zifgu Aug 17, 2022
f5be2f4
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 17, 2022
f0bd59b
Remove data-qa attribute from "Display in Player" toggle
zifgu Aug 17, 2022
28e537b
Add specific error type when video file not found
zifgu Aug 17, 2022
ca0bdbe
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 17, 2022
7d6c416
Throw "file not found" error when caption file does not exist
zifgu Aug 17, 2022
a0e8c2a
Correct signature of function that is no longer async
zifgu Aug 17, 2022
c5c4e22
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 17, 2022
132ed19
Handle and display error when captions fail to upload
zifgu Aug 17, 2022
9397bed
Fix bug in argument passing
zifgu Aug 18, 2022
89876df
Bug fix: raises error when video found to be still converting
zifgu Aug 18, 2022
22c0bc5
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 18, 2022
e191dea
Add button to download caption
zifgu Aug 18, 2022
d01d25d
Make toggle switch labels reflect current state
zifgu Aug 18, 2022
70c3c3d
Include SRT in pending caption error message
zifgu Aug 18, 2022
e0af999
Fix missing check for serviceUrl in kalturaData
zifgu Aug 19, 2022
767c747
Use addApiError to add caption errors
zifgu Aug 22, 2022
cdd04d5
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 22, 2022
85d5f61
Add operations menu; move export/duplicate and thumnail optimization …
zifgu Aug 23, 2022
1e84fc0
Record analytics events for operations modals
zifgu Aug 23, 2022
b9f1811
Clean up operations button styles
zifgu Aug 23, 2022
b4dee3c
Move SettingsModal out of its own folder
zifgu Aug 23, 2022
cbb648c
Fix failing export/duplicate tests
zifgu Aug 23, 2022
8ad5dd6
Add accessible labels to checkboxes in upload dashboard
zifgu Aug 23, 2022
1d51159
Merge branch '1242-separate-operation-modals' into 1168-kaltura-uploa…
zifgu Aug 23, 2022
8e5aa47
Lint files
zifgu Aug 23, 2022
67a25d6
Move Kaltura upload dashboard to its own modal
zifgu Aug 23, 2022
70b85a4
No longer show fatal error messages to the user to avoid exposing the…
zifgu Aug 23, 2022
59e2a34
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 23, 2022
4d0b9c9
Specify precondition for checkVideoFileSize
zifgu Aug 23, 2022
de81b14
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 23, 2022
5b0889c
Make upload error dismissible; clear upload error when "Clean Uploade…
zifgu Aug 23, 2022
b85f84e
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 23, 2022
c8178af
Fix overlay and Change button appearing above error banner
zifgu Aug 23, 2022
06cd5a2
Add !important to override Bootstrap style
zifgu Aug 23, 2022
293bc0b
Fix Kaltura upload log not refreshing
zifgu Aug 23, 2022
62dfea2
Fix: when Kaltura modal opened, refresh list of uploadable videos
zifgu Aug 23, 2022
11682a5
Fix: Do not throw error when uploading captions
zifgu Aug 23, 2022
e313296
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 23, 2022
ae5fbf8
Add aria-label to operations button
zifgu Aug 25, 2022
e9d276e
Fix import path for DuplicateTapestryButton
zifgu Aug 25, 2022
230ddd5
Merge branch '1242-separate-operation-modals' into 1168-kaltura-uploa…
zifgu Aug 25, 2022
40f1fcc
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 25, 2022
ce80ffc
Fix unneeded and missing imports
zifgu Aug 25, 2022
5bb1c86
Add error type for FAILED_TO_ESTABLISH_KALTURA_SESSION
zifgu Aug 25, 2022
8a01fac
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 25, 2022
9916eae
Minor style changes and refactoring
legendword Aug 25, 2022
e8f8809
Import * as wp instead of importing getKalturaStatus
zifgu Aug 26, 2022
edbd367
Fix: no longer send add caption request to Kaltura if file is invalid
zifgu Aug 26, 2022
cdc4d3e
Change video upload endpoint to take a Tapestry ID + list of node IDs
zifgu Aug 26, 2022
a83d2de
Store latest Tapestry to upload; only show error if from this Tapestr…
zifgu Aug 26, 2022
5bc60a3
Update example response body in comment
zifgu Aug 26, 2022
e363097
Disable checkboxes in upload dashboard when overlay applied - improve…
zifgu Aug 26, 2022
85bfa97
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 26, 2022
13a672a
Bug fix: Cannot import tapestries not containing obsolete "groups" pr…
wynnset Aug 26, 2022
f09c776
Do not submit node if error occurs during submission
zifgu Aug 29, 2022
ef23bc3
Add Kaltura category structure option to Settings page
zifgu Aug 29, 2022
df4c758
Add Tapestry>site URL category when uploading videos
zifgu Aug 29, 2022
82d2045
Refactor category creation; reuse Kaltura session if possible
zifgu Aug 29, 2022
e077636
Implement categorizing by date or Tapestry depending on setting
zifgu Aug 29, 2022
6e6b0ed
Validate Tapestry ID before starting upload
zifgu Aug 29, 2022
a12a6a0
Use 'date' as category structure when invalid or no value given
zifgu Aug 29, 2022
b11eced
Edit category structure setting description
zifgu Aug 29, 2022
8b38070
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 29, 2022
472060d
Add ability to upload video to Kaltura directly from NodeModal
zifgu Aug 30, 2022
f37ff9b
Extract Kaltura category logic to helper
zifgu Aug 30, 2022
474ec4f
Add Upload button instead of uploading after file chosen
zifgu Aug 30, 2022
2c0db32
Disable upload button when needed; clear file when done uploading
zifgu Aug 30, 2022
c32c6aa
Wait for Kaltura video duration to load
zifgu Aug 30, 2022
d9c563c
Remove duplicated function
zifgu Aug 30, 2022
439b433
Delete unused line
zifgu Aug 30, 2022
1fbccb0
Add select field for mediaFormat; give each media format its own form
zifgu Aug 30, 2022
928b3c2
Add option to choose video player for Kaltura video
zifgu Aug 30, 2022
0d65f5b
Fix failing Jest test for YouTube videos
zifgu Aug 30, 2022
87ef50c
Fix typo in import statement
zifgu Aug 30, 2022
aef0d3c
Fix video tests; add test for Kaltura video thumbnail
zifgu Aug 30, 2022
fb10edc
Make margin on URL video form consistent with other forms
zifgu Aug 30, 2022
2eb6464
Fix youtube URL and mp4 URL sharing the same test id
zifgu Aug 30, 2022
ad26b75
Change video URL ids in integration test as well
zifgu Aug 30, 2022
7a9f34f
Change video URL ids in node authoring test
zifgu Aug 30, 2022
2ecb519
Add alert after video successfully uploaded to Kaltura
zifgu Aug 30, 2022
66b59c6
Force permissions on upload video endpoint
zifgu Aug 30, 2022
feeeec4
Delete fixed todo
zifgu Aug 30, 2022
d6c8eb5
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 31, 2022
68dc32f
Complete merge; allow SRT captions only for Kaltura videos using Kalt…
zifgu Aug 31, 2022
8a00b77
Fix failing end-to-end and integration tests
zifgu Aug 31, 2022
bec9978
Wait for assertion that caption URLs are vtt files
zifgu Aug 31, 2022
9fabb20
1247 - Override default Kaltura account on individual sites (#1248)
zifgu Aug 31, 2022
58b0b9e
1241 - Persist log of Kaltura uploads (#1243)
zifgu Aug 31, 2022
f50f359
1238 - Disable Kaltura features when Kaltura not available in the bac…
zifgu Aug 31, 2022
3a25a18
Merge branch 'master' into 1242-separate-operation-modals
wynnset Aug 31, 2022
82c011c
Rename Tapestry Operations to just Operations
zifgu Aug 31, 2022
7dba59b
Move modals outside of b-dropdown
zifgu Aug 31, 2022
9e24f85
Merge branch '1242-separate-operation-modals' into 1168-kaltura-uploa…
zifgu Aug 31, 2022
9c9c24c
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 31, 2022
15436b9
Handle errors when uploading captions, to be safe
zifgu Aug 31, 2022
cb211d9
Change caption error to less specific error type
zifgu Aug 31, 2022
f65559b
Merge branch 'master' into 1242-separate-operation-modals
wynnset Aug 31, 2022
bba6d37
fix another file name
wynnset Aug 31, 2022
ccd279a
styling improvements
wynnset Aug 31, 2022
8072e1f
Disable captions fields when captions are loading
zifgu Aug 31, 2022
c1f752e
Clear pending captions when changing video format
zifgu Aug 31, 2022
31a145d
Merge branch 'master' into 1242-separate-operation-modals
wynnset Aug 31, 2022
efdfb79
Merge branch '1242-separate-operation-modals' into 1168-kaltura-uploa…
wynnset Aug 31, 2022
c73c20e
Focus added caption after adding back a pending caption
zifgu Aug 31, 2022
e18a40a
Bug fix: set video player to "regular" if useKalturaPlayer is false
zifgu Aug 31, 2022
c7cac20
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 31, 2022
abfb878
Improve error handling
zifgu Aug 31, 2022
0f1e1ac
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Aug 31, 2022
bc4bd93
Hide "Clean Uploaded Videos" when Kaltura is not available
zifgu Aug 31, 2022
8644334
1238 - Disable Kaltura features when Kaltura not available in the bac…
zifgu Aug 31, 2022
9d40f56
Hide Kaltura Upload settings section when Kaltura not available
zifgu Aug 31, 2022
5a1c68d
Separate Kaltura modal into Upload and Log tabs
zifgu Sep 1, 2022
413aecb
Better spacing on upload alerts
zifgu Sep 1, 2022
80d0736
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
zifgu Sep 1, 2022
c9b73a1
Improve caption error handling
zifgu Sep 1, 2022
4f6e59e
Allow unsetting the default caption for URL videos
zifgu Sep 1, 2022
7ad4582
Merge branch 'master' into 1168-kaltura-upload-dashboard
wynnset Sep 6, 2022
01f39f0
Add check for valid youtube URL
legendword Sep 7, 2022
7ac3ff0
Switch to URL video when youtubeID is empty
legendword Sep 8, 2022
b23c71f
Add leading zero to hour in upload log
legendword Sep 9, 2022
1938f48
Refactor KalturaModal into its own directory
legendword Sep 9, 2022
f942404
Add notice when upload is in progress
legendword Sep 9, 2022
110a6b3
Clear upload alert text on new upload in NodeModal
legendword Sep 9, 2022
35f272a
Warn user before closing node modal when an upload is in progress
legendword Sep 14, 2022
dfd98d1
Place alerts above Kaltura modal tabs
legendword Sep 21, 2022
733e9ba
Show red dot when Kaltura upload finishes while modal is closed
legendword Sep 21, 2022
9c7554f
Save notifications state in tapestry
legendword Sep 24, 2022
87f0364
Refactor updateTapestryNotifications endpoint
legendword Sep 24, 2022
588c370
Show number of failed videos in alert when video finishes
legendword Sep 24, 2022
45e5217
Use b-badge for notification badge (operations button and review noti…
legendword Sep 24, 2022
c03beaf
Minor bug fixes and styling improvements
legendword Sep 24, 2022
35980c2
Merge branch 'master' into 1168-kaltura-upload-dashboard
legendword Sep 25, 2022
9959190
Fix conflict of getTypeData method; improve code from master
legendword Sep 27, 2022
947b35a
Refactoring and minor UI improvements
wynnset Oct 14, 2022
944533c
Remove unused import
legendword Oct 18, 2022
eeef8d5
More refactoring and some text updates
wynnset Oct 18, 2022
afdd431
More refactoring and code improvements
wynnset Oct 18, 2022
5bedf31
Merge branch 'master' into 1168-kaltura-upload-dashboard
wynnset Oct 18, 2022
1c5b0dc
Merge branch 'master' into 1168-kaltura-upload-dashboard
wynnset Oct 18, 2022
4d02285
Merge branch '1168-kaltura-upload-dashboard' into 1213-video-captions
wynnset Oct 19, 2022
4dc8226
fix
wynnset Oct 19, 2022
e1922bc
Merge branch 'master' into 1213-video-captions
wynnset Oct 19, 2022
a7a21e9
Fix issues causing WP to reject vtt file uploads
wynnset Oct 26, 2022
4f259b3
Merge branch 'master' into 1213-video-captions
wynnset Oct 28, 2022
d34a920
Merge branch 'master' into 1213-video-captions
wynnset Nov 10, 2022
5c5e374
Fit Kaltura videos properly inside multi-content and ensure it keeps …
wynnset Nov 11, 2022
db3d32d
Allow deleting all captions and ensure we set the first added caption…
wynnset Nov 11, 2022
bb9545b
Merge branch '1213-video-captions' into 1277-kaltura-fixes
wynnset Nov 11, 2022
6b3bcdb
Fixes:
wynnset Nov 14, 2022
7b43ae1
Remove unused hasMultiContentContext
legendword Nov 14, 2022
c9fb5fa
Fix issues related to multiple videos on the same page and minimize n…
wynnset Nov 25, 2022
101eb91
Merge branch 'master' into 1277-kaltura-fixes
wynnset Nov 25, 2022
e1145c1
Merge branch 'master' into 1213-video-captions
wynnset Nov 29, 2022
7f74feb
Merge branch '1213-video-captions' into 1277-kaltura-fixes
wynnset Nov 29, 2022
1ddd9b4
Move video.config.js to _config.js to standardize config file names
wynnset Nov 30, 2022
f2cea25
Move fitMediaInContainer to a mixin that can be shared across components
wynnset Nov 30, 2022
6350740
Merge branch 'master' into 1213-video-captions
wynnset Dec 12, 2022
7f4d946
Fix h5p video media fullscreen node detection
legendword Dec 19, 2022
1739456
Merge branch 'master' into 1213-video-captions
legendword Dec 19, 2022
2b44ace
Fix tests
legendword Dec 19, 2022
d9f93f7
Add static keyword to Kaltura endpoints
legendword Dec 19, 2022
ac78a3d
Add error handler for video on source element
legendword Dec 19, 2022
f753e72
Merge branch '1213-video-captions' into 1277-kaltura-fixes
legendword Dec 19, 2022
24f9c4a
Merge branch 'master' into 1213-video-captions
legendword May 4, 2023
650295a
Merge branch '1213-video-captions' into 1277-kaltura-fixes
legendword May 5, 2023
0877b84
Merge branch 'master' into 1213-video-captions
legendword May 16, 2023
6e41d77
Merge branch '1213-video-captions' into 1277-kaltura-fixes
legendword May 16, 2023
c1d67f3
Merge branch 'master' into 1277-kaltura-fixes
legendword Jun 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@
<div v-if="node.mediaType !== 'multi-content'">
<tapestry-media
:node-id="node.id"
:dimensions="dimensions"
:dimensions="tapestryMediaDimensions"
context="multi-content"
:hide-title="presentationStyle === 'accordion'"
style="margin-bottom: 24px;"
@complete="complete"
@load="handleLoad(null)"
@change:dimensions="updateDimensions"
/>
<multi-content-rows
v-if="children.length > 0"
Expand Down Expand Up @@ -166,6 +167,7 @@ export default {
data() {
return {
isVisible: this.presentationStyle === "page",
tapestryMediaDimensions: this.dimensions,
}
},
computed: {
Expand Down Expand Up @@ -217,6 +219,11 @@ export default {
handleAutoClose() {
this.$emit("close")
},
updateDimensions(newDimensions) {
if (typeof newDimensions.height === "undefined" || newDimensions.height > 0) {
this.tapestryMediaDimensions = { ...this.dimensions, ...newDimensions }
}
},
},
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@
</template>

<script>
import videoMediaMixins from "./_mixins.js"
import { mapGetters, mapActions, mapState } from "vuex"
import client from "@/services/TapestryAPI"
import { SEEK_THRESHOLD } from "./video.config"
import { SEEK_THRESHOLD } from "./_config"
import Helpers from "@/utils/Helpers"

// How often to update the H5P settings (in seconds)
const updateSettingsInterval = 10

export default {
name: "h5p-video-media",
mixins: [videoMediaMixins],
props: {
node: {
type: Object,
Expand Down Expand Up @@ -140,33 +142,31 @@ export default {
setFrameDimensions() {
const h5pDimensions = this.instance.parent.$container[0].getBoundingClientRect()
// default
this.frameHeight = h5pDimensions.height
this.frameWidth = 0
if (this.node.fitWindow || this.hasMultiContentContext) {
this.frameHeight = h5pDimensions.height
if (
(this.node.fullscreen && this.node.fitWindow) ||
this.hasMultiContentContext
) {
// Video should fit within the smaller of the viewport or the container it's in
let fitHeight = window.innerHeight
let containerDimensions = {
height: window.innerHeight,
}
if (this.hasMultiContentContext) {
// Count for the header
// TODO: Find a better way of doing this without hardcoding the heigh value
fitHeight -= 100
}
// Proportionally make the frame smaller
let scaleFactor = fitHeight / h5pDimensions.height
this.frameHeight = h5pDimensions.height * scaleFactor
this.frameWidth = h5pDimensions.width * scaleFactor
// if the width is bigger than the available space, we need to scale based on the width
let fitWidth = this.$refs.h5pIframeContainer.clientWidth
if (this.frameWidth > fitWidth) {
scaleFactor = fitWidth / h5pDimensions.width
this.frameWidth = h5pDimensions.width * scaleFactor
this.frameHeight = h5pDimensions.height * scaleFactor
// TODO: Find a better way of doing this without hardcoding the height value
containerDimensions.height -= 100
}
;[this.frameWidth, this.frameHeight] = this.fitMediaInContainer(
h5pDimensions,
containerDimensions
)
}
// Fix for unknown issue where H5P height is just a bit short
if (this.frameHeight) {
this.frameHeight += 2
}
let updatedDimensions = { height: this.frameHeight }
const updatedDimensions = { height: this.frameHeight }
if (this.frameWidth) {
updatedDimensions.width = this.frameWidth
}
Expand Down Expand Up @@ -302,23 +302,14 @@ export default {
handleLoad() {
const h5pObj = this.$refs.h5p.contentWindow.H5P
const h5pInstance = h5pObj.instances[0]
const loadedH5PId = h5pInstance.contentId
this.library = h5pInstance.libraryInfo.machineName

this.frameHeight = this.dimensions.height
// Check to see whether this is an H5P recorder
// If it is, we can emit an event to load the recorded audio (if exists)
// and terminate
if (h5pInstance.recorder && loadedH5PId) {
this.loadedH5PRecorderId = loadedH5PId
this.h5pRecorderSaverIsLoaded()
return
}
const mediaProgress = this.node.progress

this.frameHeight = this.$refs.h5p.contentWindow.document.activeElement.children[0].clientHeight
this.$emit("change:dimensions", { height: this.frameHeight })

const h5pVideo = h5pInstance.video
const h5pIframeComponent = this

const handleH5pAfterLoad = () => {
h5pIframeComponent.instance = h5pVideo
window.addEventListener("resize", h5pIframeComponent.setFrameDimensions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
// Prevent linter warning on use of kWidget variable
/*global kWidget*/

import videoMediaMixins from "./_mixins.js"
import client from "@/services/TapestryAPI"
import { mapState, mapMutations } from "vuex"

export default {
name: "kaltura-video-media",
name: "kaltura-media",
mixins: [videoMediaMixins],
props: {
node: {
type: Object,
Expand All @@ -26,6 +29,11 @@ export default {
return ["width", "height"].every(prop => val.hasOwnProperty(prop))
},
},
context: {
type: String,
required: false,
default: "lightbox",
},
playing: {
type: Boolean,
required: true,
Expand All @@ -37,46 +45,49 @@ export default {
},
data() {
return {
onLoad: true,
playerId: "",
amountViewed: 0,
}
},
computed: {
...mapState(["kalturaScriptsLoaded"]),
kalturaId() {
return this.node.typeData.kalturaId
},
},
watch: {
playing() {
if (this.playing && this.playerId) {
const kalturaVideo = document.getElementById(this.playerId)
if (this.onLoad) {
const videoDuration = kalturaVideo.evaluate("{duration}")
const currentTime = this.node.progress * videoDuration

this.$emit("timeupdate", {
amountViewed: this.node.progress,
currentTime,
})

kalturaVideo.sendNotification("doSeek", currentTime)
this.lastTime = currentTime
this.onLoad = false
}
}
},
},
created() {
const kalturaScript = document.createElement("script")
mounted() {
const partnerId = this.node.typeData.kalturaData.partnerId
const serviceUrl = this.node.typeData.kalturaData.serviceUrl
const uniqueConfiguration = this.node.typeData.kalturaData.uniqueConfiguration
kalturaScript.src = `${serviceUrl}/p/${partnerId}/sp/${partnerId}00/embedIframeJs/uiconf_id/${uniqueConfiguration}/partner_id/${partnerId}`

kalturaScript.id = "kaltura-script"
const kalturaScriptId = `tapestry-kaltura-script-${serviceUrl}-${partnerId}-${uniqueConfiguration}`

kalturaScript.addEventListener("load", () => {
let kalturaScript = document.getElementById(kalturaScriptId)

if (this.kalturaScriptsLoaded.includes(kalturaScriptId)) {
this.handleScriptLoaded(partnerId, uniqueConfiguration)
} else if (kalturaScript) {
kalturaScript.addEventListener("load", () => {
this.addKalturaScriptLoaded(kalturaScriptId)
this.handleScriptLoaded(partnerId, uniqueConfiguration)
})
} else {
kalturaScript = document.createElement("script")
kalturaScript.src = `${serviceUrl}/p/${partnerId}/sp/${partnerId}00/embedIframeJs/uiconf_id/${uniqueConfiguration}/partner_id/${partnerId}`
kalturaScript.id = kalturaScriptId
kalturaScript.addEventListener("load", () => {
this.addKalturaScriptLoaded(kalturaScriptId)
this.handleScriptLoaded(partnerId, uniqueConfiguration)
})
document.head.appendChild(kalturaScript)
}
},
beforeDestroy() {
window.removeEventListener("resize", this.setFrameDimensions)
},
methods: {
...mapMutations(["addKalturaScriptLoaded"]),
handleScriptLoaded(partnerId, uniqueConfiguration) {
kWidget.embed({
targetId: `kaltura-container-${this.node.id}`,
wid: `_${partnerId}`,
Expand All @@ -96,8 +107,16 @@ export default {

kalturaIframe.onload = () => {
kWidget.addReadyCallback(playerId => {
this.playerId = playerId
const kalturaVideo = document.getElementById(playerId)
if (!kalturaVideo.contains(kalturaIframe)) {
return
}
this.playerId = playerId

if (this.context === "multi-content") {
this.setFrameDimensions()
window.addEventListener("resize", this.setFrameDimensions)
}

kalturaVideo.kBind("playerUpdatePlayhead", currentTime => {
const videoDuration = kalturaVideo.evaluate("{duration}")
Expand Down Expand Up @@ -137,7 +156,7 @@ export default {
)
})

kalturaVideo.kBind("seeked", seekedTime => {
kalturaVideo.kBind("userInitiatedSeek", seekedTime => {
this.$emit("seeked", { currentTime: seekedTime })
})

Expand All @@ -150,23 +169,46 @@ export default {
const nodeProgress = this.node.progress
const videoDuration = kalturaVideo.evaluate("{duration}")
const currentTime = nodeProgress * videoDuration

try {
kalturaVideo.sendNotification("doSeek", currentTime)
} catch (e) {
try {
kalturaVideo.kBind("mediaReady", function() {
kalturaVideo.sendNotification("doSeek", currentTime)
})
} catch (e) {
console.error("Kaltura player could not seek to its saved position", e)
}
}

this.$emit("load", { currentTime, type: "kaltura-video" })
})
}
})

document.head.appendChild(kalturaScript)
},
beforeDestroy() {
const kalturaScript = document.getElementById("kaltura-script")
document.head.removeChild(kalturaScript)
},
methods: {
},
updateVideoProgress(currentTime, duration) {
this.amountViewed = currentTime / duration
this.$emit("timeupdate", { amountViewed: this.amountViewed, currentTime })
this.lastTime = currentTime
},
setFrameDimensions() {
const kalturaVideo = document.getElementById(this.playerId)
const media = kalturaVideo.evaluate("{mediaProxy.entry}")

if (media) {
const containerDimensions = {
width: kalturaVideo.evaluate("{video.player.width}"),
height: window.innerHeight,
}
const updatedDimensions = this.fitMediaInContainer(
media,
containerDimensions
)
// Account for the height of the kaltura player bar
updatedDimensions.height += 36
this.$emit("change:dimensions", updatedDimensions)
}
},
playVideo() {
if (this.playerId) {
const kalturaVideo = document.getElementById(this.playerId)
Expand All @@ -180,11 +222,12 @@ export default {
}
},
reset() {
this.onLoad = false
const kalturaVideo = document.getElementById(this.playerId)
this.updateVideoProgress(0, kalturaVideo.evaluate("{duration}"))
kalturaVideo.sendNotification("doSeek", 0)
this.$emit("timeupdate", { amountViewed: this.amountViewed, currentTime: 0 })
if (this.playerId) {
const kalturaVideo = document.getElementById(this.playerId)
this.updateVideoProgress(0, kalturaVideo.evaluate("{duration}"))
kalturaVideo.sendNotification("doSeek", 0)
this.$emit("timeupdate", { amountViewed: this.amountViewed, currentTime: 0 })
}
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import ISO6391 from "iso-639-1"
import { mapMutations } from "vuex"
import client from "@/services/TapestryAPI"
import { SEEK_THRESHOLD } from "./video.config"
import { SEEK_THRESHOLD } from "./_config"
import PlayScreen from "./PlayScreen"

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import { mapState, mapActions } from "vuex"
import Helpers from "@/utils/Helpers"
import client from "@/services/TapestryAPI"
import { SEEK_THRESHOLD } from "./video.config"
import { SEEK_THRESHOLD } from "./_config"
import { data as wpData } from "@/services/wp"

// Set as per https://developers.google.com/youtube/iframe_api_reference#Playback_status
Expand Down
20 changes: 20 additions & 0 deletions templates/vue/src/components/Lightbox/media/VideoMedia/_mixins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export default {
methods: {
fitMediaInContainer(media, container) {
// First, we scale the media based on height
let scaleFactor = container.height / media.height
const updatedDimensions = {
width: media.width * scaleFactor,
height: media.height * scaleFactor, // equals == container.height
}

// if the width is bigger than the available space, we need to scale based on the width
if (updatedDimensions.width > container.width) {
scaleFactor = container.width / media.width
updatedDimensions.width = media.width * scaleFactor
updatedDimensions.height = media.height * scaleFactor
}
return updatedDimensions
},
},
}
Loading