technowledgy / vue-h5p

A vue h5p component for h5p content
MIT License
16 stars 13 forks source link
[![GitHub Actions](https://img.shields.io/github/actions/workflow/status/technowledgy/vue-h5p/push.yaml?branch=main)](https://github.com/technowledgy/vue-h5p/actions/workflows/push.yaml) [![Coveralls GitHub](https://img.shields.io/coveralls/github/technowledgy/vue-h5p)](https://coveralls.io/github/technowledgy/vue-h5p) [![Dependabot](https://img.shields.io/badge/dependabot-enabled-success)](https://github.com/technowledgy/vue-h5p/blob/main/package.json) [![License](https://img.shields.io/npm/l/vue-h5p)](https://github.com/technowledgy/vue-h5p/blob/main/LICENSE) [![npm](https://img.shields.io/npm/v/vue-h5p)](https://www.npmjs.com/package/vue-h5p) ![vue](https://img.shields.io/badge/vue-2.x-brightgreen)

vue-h5p

A vue h5p component for displaying H5P content standalone, inspired by tunapanda/h5p-standalone.

Installation

With module loader

npm install vue-h5p

or

yarn add vue-h5p

in your component:

<template>
  <h5p src="https://github.com/technowledgy/vue-h5p/raw/main/path/to/h5p-content" :l10n="translations" @xapi="handleXAPIEvent">
    Loading...
    <template #error>
      Resource not available. :(
    </template>
  </h5p>
</template>

<script>
import h5p from 'vue-h5p'
import translations from './translations'

export default {
  components: {
    h5p
  },
  computed: {
    translations () {
      return translations
    }
  },
  methods: {
    handleXAPIEvent (ev) {
      console.log('H5P emitted X-API event')
    }
  }
}
</script>

Props

The component accepts the following props:

Prop Required Type Default Description
copy no Boolean false Enable copy button
copyright no Boolean false Enable copyright button
css no String '' Inject css into a