https://github.com/openfun/marsha-plugins
https://github.com/openfun/marsha-plugins
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/openfun/marsha-plugins
- Owner: openfun
- License: mit
- Created: 2019-11-08T11:12:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-12T14:17:54.000Z (over 6 years ago)
- Last Synced: 2025-01-13T12:48:44.796Z (over 1 year ago)
- Language: HCL
- Size: 8.79 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Marsha plugins
This repo contains optional plugins for the [Marsha](https://github.com/openfun/marsha) application.
Plugins are pure JavaScript files injected in the [LTI template](https://github.com/openfun/marsha/blob/e5dec6b8ae662ab35950e5976296653cb29dbd7c/src/backend/marsha/core/templates/core/lti.html#L14-L16) and executed when the target `iframe` is loaded.
## Getting started
Javascript file are hosted on an AWS S3 bucket and distrbuted using AWS CloudFront. To bootstrap everything we use terraform.
🔧 **Before you go further**, you need to create `./src/aws/env.d/development` and replace the relevant values with your own.
$ cp ./env.d/development.dist ./env.d/development
Create the shared state bucket where `Terraform` will keep all the information on your deployments so different developers/machines/CI processes can interact with them:
$ make state-create
Initialize your `Terraform` config:
$ make init
In order to have multiple environments (_e.g._ `development`, `staging`, `preproduction` and `production`) you must create a Terraform workspace and use it before deploying the project:
$ ./bin/terraform workspace create development
Then you can create the architecture and deploy all plugins:
$ make deploy
At then end of the deployment terraform will output the AWS CloudFront url you will use to distribute javascript files.
## Available plugins
### Adways
Adways is an interactive videos solution. The plugin lives in `src/static/js/adways.js`. To distribute it the URL will be: `https://yourCloudFrontDomain.com/static/js/adways.js`.
To use it with marsha, the adways publication id must be added in the LTI url using the `adways_id` query string, this will automatically activate the plugin. Example: `https://marsha.education/lti/videos/7693f1cb-572e-4439-8f5a-e9ca5c32f062?adways_id={YOUR_PUBLICATION_ID}`.