Skip to content
This repository has been archived by the owner. It is now read-only.
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Send Youtube Video interactions to an LRS with xAPI

This script uses YouTube's iframe API to build statements with xapi-youtube-statements.js when events are fired.

These statements can be dispatched to an LRS with xapiwrapper.min.js using a custom ADL.XAPIYoutubeStatements.onStateChangeCallback function.

Check out for a live demo.

This script also uses xAPI Launch to establish the connection to the LRS from our application.


git clone or download using the download link


In index.html change:

Video ID

var video = "tlBbt5niQto"; // Change this to your video ID

Update actor credentials

// "global" variables read by ADL.XAPIYoutubeStatements
  "actor":  {"mbox":"", "name":"anonymous"},
  "videoActivity": {"id":"" + video, "definition":{"name": {"en-US":video}} }

Update xAPIWrapper information

// Auth for the LRS
var conf = {
    "endpoint" : "",
    "auth" : "Basic " + toBase64("xapi-tools:xapi-tools"),


Host the github project files on your server. Launch index.html.

##Examples See xapi-youtube-statements.js for examples on how to integrate with IFrame.

For more information on how to dispach statements to an LRS, see our example

Contributing to the project

We welcome contributions to this project. Fork this repository, make changes, and submit pull requests. If you're not comfortable with editing the code, please submit an issue and we'll be happy to address it.


Copyright ©2016 Advanced Distributed Learning

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

You can’t perform that action at this time.