-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add xapi video verbs #17
base: master
Are you sure you want to change the base?
Conversation
Added code to handle seeked event and trigger an xAPI statement
added code for sending following events -seek -volume change -fullscreen -play -pause -Initiated I haven’t actually been able to get the fullscreen event to trigger
Used Youtube Video API to implement: -Seek -Play -Pause -Initiated This is all that was possible via their API
Play wasn’t firing with play button was hit all the time so I added functionality in the state change event to evaluate if play event needed to be triggered.
Moved completion params into a function
Haven’t been able to get this code to call for testing in any video upload with Wordpress so I am not adding functionality for this.
Fine tuned seek event more. It is working very well on HTML5 still need some work on Youtube for the events when a user is scrubbing.
Made sure all floats in played segments were formatted to correct precision
maintainer uses 2 spaces for indentation, make sure to follow this style.
Use template getArgsXAPI{verb} instead of getxAPI{verb}Object
xAPI verbs are past tense, so make the function names match.
html5 video object has a property called currentTime, not current_time
Added code to handle seeked event and trigger an xAPI statement
added code for sending following events -seek -volume change -fullscreen -play -pause -Initiated I haven’t actually been able to get the fullscreen event to trigger
Used Youtube Video API to implement: -Seek -Play -Pause -Initiated This is all that was possible via their API
Was asked by Jon to add video length to the extensions sent by the intialized verb.
…-video into add-xapi-video-verbs # Conflicts: # scripts/html5.js # scripts/youtube.js
Youtube was passing 0 in for video duration so I changed this to use the api’s method to get video length.
A quick update: There are some free days in May that I'll try to use to come up with the "final implementation". |
Updating the currently playing segment start time when the video starts playing is required in certain scenarios. For example, If a user revisits a page with a youtube video that they had previously partially watched, the video will resume from where they left off. If we don’t set `playingSegmentStart` on the play event, the first playing segment recorded will start at 0 (the beginning of the video) rather than the timecode the video resumed from.
Aloha @otacke, just checking in. Today I fixed some regressions caused by a botched merge last month (94ff7b3), everything looks good now. I also reverted your commit 6dd68ac in 26b8f94 because I found an edge case where a newly initialized video resumed from where the user had previously left off, requiring that @jmkevan has reviewed and tested video statements sent to an LRS and hasn't found any issues. Let us know if you have any questions or comments! Cheers, -p |
@figureone @jmkevan Thanks for the update, fixing the bug, and testing everything! I'm really sorry for not having worked on this issue, but I simply couldn't find the time so far. |
@otacke - Checking in on this. I hate to be pushy, but we have several projects that are running out of time to use this functionality. We are really hoping you can get this finalized in the next several weeks! We appreciate all your time and effort!
|
Hi Jon!
Unfortunately, I am not the bearer of good news. We have several
deadlines that keep us busy this summer, so Joubel will probably
not be able to jump in before fall. However, I am totally willing
to put in some effort in my spare time -- I really like the idea
of xAPI -- but I'll definitely not come around to it before July.
Best,
Oliver
Kind regards,
Oliver Tacke
h5p/h5p-video on June 6, 2018 at 10:17pm wrote:
@otacke ( https://github.com/otacke )- Checking in on this. I
hate to be pushy, but we have several projects that are running
out of time to use this functionality. We are really hoping you
can get this finalized in the next several weeks!
We appreciate all your time and effort!
* Jon
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
( #17 (comment) )
, or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbHrjCh0easjEdJIMMNGpg93JhpV9ks5t6DjxgaJpZM4QoLa4 )
.
h5p/h5p-video on May 28, 2018 at 9:00am wrote:
@figureone ( https://github.com/figureone )@jmkevan
( https://github.com/jmkevan ) Thanks for the update, fixing the
bug, and testing everything! I'm really sorry for not having
worked on this issue, but I simply couldn't find the time so far.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
( #17 (comment) )
, or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbCxMypmhqIoSPJRaenf5SfsAw1tJks5t26CPgaJpZM4QoLa4 )
.
h5p/h5p-video on May 26, 2018 at 1:44am wrote:
Aloha @otacke ( https://github.com/otacke ), just checking in.
Today I fixed some regressions caused by a botched merge last
month (94ff7b3
( 94ff7b3 )
), everything looks good now.
I also reverted your commit 6dd68ac
( 6dd68ac )
in 26b8f94
( 26b8f94 )
because I found an edge case where a newly initialized video
resumed from where the user had previously left off, requiring
that playingSegmentStart be set in the play event (otherwise a
segment from 0 to the resumed timecode would be inserted).
@jmkevan ( https://github.com/jmkevan ) has reviewed and tested
video statements sent to an LRS and hasn't found any issues.
Let us know if you have any questions or comments! Cheers, -p
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
( #17 (comment) )
, or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbMPTO09HvkN_rDtfk_3bYLWOkZbxks5t2JdcgaJpZM4QoLa4 )
.
h5p/h5p-php-library on May 26, 2018 at 1:37am wrote:
@figureone ( https://github.com/figureone )pushed 1 commit.
* 17052be ( 17052be )
Merge remote-tracking branch 'upstream/master' into
add-xapi-video-verbs
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/26b8f940247678acc7898b61ef39de1003b4608e..17052beed98f4ad725b124747b080fc7b9dc8968 )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbDDifpi6ObutbuIBvLNEJeceDO-iks5t2JWygaJpZM4QoLa4 )
.
h5p/h5p-php-library on May 25, 2018 at 11:12pm wrote:
@figureone ( https://github.com/figureone )pushed 1 commit.
* 26b8f94 ( 26b8f94 )
Revert 6dd68ac
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/4f595f75bcd687ee528222a55429a3d85268c237..26b8f940247678acc7898b61ef39de1003b4608e )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbDuCdgE5KLi4cxR0MQp90UTM6TSPks5t2HO9gaJpZM4QoLa4 )
.
h5p/h5p-php-library on May 25, 2018 at 10:09pm wrote:
@figureone ( https://github.com/figureone )pushed 6 commits.
* e1af0c1 ( e1af0c1 )
Replay 5c1f995 due to incorrect merge conflict resolution in
94ff7b3
* 9d612b7 ( 9d612b7 )
Replay 1f18bdb due to incorrect merge conflict resolution in
94ff7b3
* 3e6a584 ( 3e6a584 )
Replay f977a64 due to incorrect merge conflict resolution in
94ff7b3
* 85b0b86 ( 85b0b86 )
Replay 8223c20 due to incorrect merge conflict resolution in
94ff7b3
* ef6d166 ( ef6d166 ) Add
existence check to completion-threshold extension
* 4f595f7 ( 4f595f7 )
Comments (update function doc header)
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/7ab090bc32649c3296b3d1925d049cb6aceab290..4f595f75bcd687ee528222a55429a3d85268c237 )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbMZL8TeYLqdmMHWDqEuVFVzJUXBiks5t2GT_gaJpZM4QoLa4 )
.
h5p/h5p-video on April 28, 2018 at 2:41pm wrote:
A quick update: There are some free days in May that I'll try to
use to come up with the "final implementation".
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
( #17 (comment) )
, or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbGD0uX6aDuRhcOH8kMzcaWeDG2P6ks5ttGOKgaJpZM4QoLa4 )
.
h5p/h5p-php-library on April 27, 2018 at 1:32am wrote:
@figureone ( https://github.com/figureone )pushed 4 commits.
* 3707be2 ( 3707be2 )
Don’t report video-playback-size if not defined
* d243bb1 ( d243bb1 ) Fix
logic error in determining isFullscreen
* 5501579 ( 5501579 )
Whitespace
* 7ab090b ( 7ab090b )
Don’t report video length if not defined
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/035d23a0fe2eb951e050b04bda2cfb0d395eefb3..7ab090bc32649c3296b3d1925d049cb6aceab290 )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbMjQx23N_MwtZBxngDbLeEZJrqltks5tslkdgaJpZM4QoLa4 )
.
h5p/h5p-php-library on April 25, 2018 at 5:58am wrote:
@KirkJohnson ( https://github.com/KirkJohnson )pushed 1 commit.
* 035d23a ( 035d23a ) Use
Youtube API to pass correct duration
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/94ff7b3a1e0ea4d9d82e50358927ac7a06fcddaa..035d23a0fe2eb951e050b04bda2cfb0d395eefb3 )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbJUB5tD8XdjY-Ik222VGS64_ct6Hks5tr_R6gaJpZM4QoLa4 )
.
h5p/h5p-php-library on April 24, 2018 at 1:35am wrote:
@KirkJohnson ( https://github.com/KirkJohnson )pushed 2 commits.
* 4f70c16 ( 4f70c16 ) Add
video length to initialized statement
* 94ff7b3 ( 94ff7b3 )
Merge branch 'add-xapi-video-verbs' of
https://github.com/uhm-coe/h5p-video into add-xapi-video-verbs
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/cbef27392e01e53268a13fb7ec2df48f5e4964b1..94ff7b3a1e0ea4d9d82e50358927ac7a06fcddaa )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbN2AeyHCEKJkH1VRS_LxNJGMOCrGks5trmVWgaJpZM4QoLa4 )
.
h5p/h5p-php-library on April 10, 2018 at 1:21am wrote:
@figureone ( https://github.com/figureone )pushed 7 commits.
* 5c1f995 ( 5c1f995 )
HFP-1779 Move videoXAPI variable to video.js
* 1f18bdb ( 1f18bdb )
HFP-1779 Prevent triggering paused before seeked
* f977a64 ( f977a64 )
HFP-1779 Clean up code
* 283f2e3 ( 283f2e3 )
HFP-1779 Clean code
* 6dd68ac ( 6dd68ac )
HFP-1779 Stop setting segment start time on play event
* 8223c20 ( 8223c20 )
HFP-1779 Move finished threshold to variable
* cbef273 ( cbef273 )
Merge pull request #2 from otacke/add-xapi-video-verbs
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/12912a8f282e20f8af1446e3d348d1a9d51081fc..cbef27392e01e53268a13fb7ec2df48f5e4964b1 )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbMQQEvo1iaAhxCaDHEi32Z28_Komks5tm-0EgaJpZM4QoLa4 )
.
h5p/h5p-php-library on April 4, 2018 at 9:09pm wrote:
@KirkJohnson ( https://github.com/KirkJohnson )pushed 1 commit.
* 12912a8 ( 12912a8 ) Add
Completion Threshold to initializes extensions
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/166c8d302952e4800ffad92b9d31de935304ee9a..12912a8f282e20f8af1446e3d348d1a9d51081fc )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbHhay7bWzVx8S9rWNSsyZwnUJOh2ks5tlRpVgaJpZM4QoLa4 )
.
h5p/h5p-video on March 29, 2018 at 4:46am wrote:
Thanks @otacke ( https://github.com/otacke ). Let us know if
there is anything else we can do.
On a site note, the Video CoP meets again next Monday. We will finalize the location and IRI of the completion threshold value which @figureone ( https://github.com/figureone ) set to .95. If this doesn't get finished and merged by then.. we will add it by Tuesday. * Jon — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub ( #17 (comment) ) , or mute the thread ( https://github.com/notifications/unsubscribe-auth/ATkhbKF-YQme2VdkxveGi8lJn7LU7Lspks5tjErugaJpZM4QoLa4 ) . h5p/h5p-video on March 26, 2018 at 9:08am wrote:
Sorry for being a bit quite lately. Let me have a look at the
repo tonight (Norway time :-)).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
( #17 (comment) )
, or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbOIa8WCnOCs-W3Uy9oxwMdaKMRfNks5tiJP_gaJpZM4QoLa4 )
.
h5p/h5p-video on March 23, 2018 at 9:42pm wrote:
Aloha @otacke ( /otacke ), I have merged in your PR that
refactors xAPI statement building. Thanks!
I also implemented the volumechange event for the youtube player
(currently the UI volume button only toggles mute/unmute, but the
volumechange event now fires whenever the volume changes:
f3ed616
( f3ed616 )
I also added a comment indicating that the fullscreen event isn't
fired by either the youtube or html5 players (not sure if this
was known to you folks already).
Finally, when the video ends, I made our completed statement fire
if 95% or more of the video was watched, instead of 100%. This
should cover our discussion about small millisecond differences
between play/pause timecodes.
166c8d3
( 166c8d3 )
Let me know if you have additional tasks for us! (Note that Kirk
and I will be on vacation all next week, but will jump back in
when we return.)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
( #17 (comment) )
, or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbLopzkaayRZgScNH6weobiw856fvks5thV5LgaJpZM4QoLa4 )
.
h5p/h5p-php-library on March 23, 2018 at 9:38pm wrote:
@figureone ( https://github.com/figureone )pushed 1 commit.
* 166c8d3 ( 166c8d3 )
Trigger completed statement at 95% or more watched
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/91936f3926777f7927267324679b8dea6caa85f9..166c8d302952e4800ffad92b9d31de935304ee9a )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbDvFRHjlKsSyHXyb7c2FCqKEogNeks5thV06gaJpZM4QoLa4 )
.
h5p/h5p-php-library on March 23, 2018 at 9:28pm wrote:
@figureone ( https://github.com/figureone )pushed 2 commits.
* d6e4f24 ( d6e4f24 )
Whitespace
* 91936f3 ( 91936f3 ) Add
note about fullscreen event not implemented
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/f3ed616fbfce7572f5f7279006dcee7dab3cf143..91936f3926777f7927267324679b8dea6caa85f9 )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbN_pqZ1WYyWYj4wZUJyavmWUFT0Rks5thVrhgaJpZM4QoLa4 )
.
h5p/h5p-php-library on March 23, 2018 at 9:08pm wrote:
@figureone ( https://github.com/figureone )pushed 1 commit.
* f3ed616 ( f3ed616 )
Implement volumechange event in youtube.js
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/f1323697a0213f719bd62024537889a0a2559506..f3ed616fbfce7572f5f7279006dcee7dab3cf143 )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbDMA47F-j1qoOp54nTLscVWwhn2kks5thVZRgaJpZM4QoLa4 )
.
h5p/h5p-php-library on March 23, 2018 at 8:45pm wrote:
@figureone ( https://github.com/figureone )pushed 8 commits.
* a88c17b ( a88c17b )
HFP-1779 Refactor xAPI statement building
* f3581ac ( f3581ac )
HFP-1779 Allow false for full-screen extension on init
* 0585bbb ( 0585bbb )
HFP-1779 Build xAPIObject with base information only once
* 94aa8c2 ( 94aa8c2 )
HFP-1779 Move xAPI trigger to video.js
* 40db1c3 ( 40db1c3 )
HFP-1779 Move video state variables to video object
* d0bc373 ( d0bc373 )
HFP-1779 Allow different verb definition origins
* 83c472a ( 83c472a )
Merge remote-tracking branch 'upstream/add-xapi-video-verbs' into
add-xapi-video-verbs
* f132369 ( f132369 )
Merge pull request #1 from otacke/add-xapi-video-verbs
—
You are receiving this because you are subscribed to this thread.
View it on GitHub
( https://github.com/h5p/h5p-video/pull/17/files/2224eddfb4543dad6608c32b9dd55a4d63d7e3e7..f1323697a0213f719bd62024537889a0a2559506 )
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbM4Y8IjH-_gtBJr1uFVm-CNAAwEgks5thVDBgaJpZM4QoLa4 )
.
h5p/h5p-video on March 15, 2018 at 12:17am wrote:
@figureonecommented on this pull request.
In scripts/x-api.js
( #17 (comment) ):
+ var xAPIObject = event.data.statement.object;
+
+ // Add definition type (required by xAPI Video Profile).
+ // @see
https://liveaspankaj.gitbooks.io/xapi-video-profile/content/statement_data_model.html#241-definition
+ xAPIObject.definition.type =
'https://w3id.org/xapi/video/activity-type/video';
+
+ // Add definition description (if video has a description).
+ if (videoInstance.contentId && H5PIntegration &&
H5PIntegration.contents && H5PIntegration.contents['cid-' +
videoInstance.contentId].jsonContent) {
+ var videoData = JSON.parse(H5PIntegration.contents['cid-' +
videoInstance.contentId].jsonContent);
+ if (videoData && videoData.interactiveVideo &&
videoData.interactiveVideo.video &&
videoData.interactiveVideo.video.startScreenOptions &&
videoData.interactiveVideo.video.startScreenOptions.shortStartDescription)
{
+ xAPIObject.definition.description = {
+ 'en-US':
videoData.interactiveVideo.video.startScreenOptions.shortStartDescription
+ };
+ }
+ }
+
Confirmed bug, I fixed it here: 4346b92
( 4346b92 )
Note that a larger fix is probably needed so we don't trigger any
xAPI statements in the editing environment. I think checking for
existence of H5PEditor should either be in core in the
triggerXAPI() definition in h5p-x-api.js:21, or we wrap each call
to triggerXAPI() with the editor check. But I think this fix will
need to wait for refactoring the xAPI event triggers out of
html5.js/youtube.js and into video.js.
Finally, good call on saving a copy of getXAPIObject(), I've done
that here: 6c0dbf9
( 6c0dbf9 )
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
( #17 (comment) ),
or mute the thread
( https://github.com/notifications/unsubscribe-auth/ATkhbK4OvjYSKqha1jKwxcR_LGdM5durks5teaUCgaJpZM4QoLa4 )
.
|
Aloha @otacke - Just thought I would check-in and see if there are any updates |
@jmkevan Actually: Yes! As you can see in our issue tracker, the ticket has been updated shortly and now lists Baduhenna as the "Fix Version". That means we want to invest some of our time to finish this task for the Baduhenna Release (that's just an internal name). |
That's fantastic. Thank Oliver! |
Hi there! any updates regarding this pull request ? |
This pull request implements xAPI statements for the following video events: initialized, played, paused, seeked, finished, and interacted.
Context: h5p/h5p-interactive-video#40 (comment)
Here is the implementation chart of the new verbs in the different players (note that we did not implement in the Flash player, but can do so as future work):
seeked
interacted
(volume changed)completed
interacted
(fullscreen)played
initialized
paused