diff --git a/projects/player/src/app/components/unit-state/unit-state.component.ts b/projects/player/src/app/components/unit-state/unit-state.component.ts index f6adf3bd9ebe5a01f8044285f5466f308f42d27f..c77fc32662f1e0381aa0ac1b35ac6b200e4721ee 100644 --- a/projects/player/src/app/components/unit-state/unit-state.component.ts +++ b/projects/player/src/app/components/unit-state/unit-state.component.ts @@ -171,8 +171,10 @@ export class UnitStateComponent implements OnInit, OnDestroy { }, presentationProgress: this.presentationProgress, responseProgress: this.responseProgress, - unitStateDataType: this.metaDataService.playerMetadata.supportedUnitStateDataTypes + unitStateDataType: '' }; + // eslint-disable-next-line no-console + console.log('player: sendVopStateChangedNotification', unitState); this.veronaPostService.sendVopStateChangedNotification({ unitState }); }); } diff --git a/projects/player/src/app/services/meta-data.service.ts b/projects/player/src/app/services/meta-data.service.ts index f96793d54f0abb5143043fad7162b0d2d7066e32..495247c199b028a0153d64fa0207066ab675a4dc 100644 --- a/projects/player/src/app/services/meta-data.service.ts +++ b/projects/player/src/app/services/meta-data.service.ts @@ -1,25 +1,17 @@ import { Inject, Injectable } from '@angular/core'; import { DOCUMENT } from '@angular/common'; -import { VopMetaData } from '../models/verona'; @Injectable({ providedIn: 'root' }) export class MetaDataService { - playerMetadata!: VopMetaData; + playerMetadata!: any; constructor(@Inject(DOCUMENT) private document: Document) { - const playerMetadata: NamedNodeMap = document.querySelectorAll('meta')[1].attributes; - this.playerMetadata = { - apiVersion: - playerMetadata.getNamedItem('data-api-version')?.value || '', - notSupportedApiFeatures: - playerMetadata.getNamedItem('data-not-supported-api-features')?.value, - supportedUnitDefinitionTypes: - playerMetadata.getNamedItem('data-supported-unit-definition-types')?.value, - supportedUnitStateDataTypes: - playerMetadata.getNamedItem('data-supported-unit-state-data-types')?.value - }; + const playerMetadata: string | null | undefined = document.getElementById('meta_data')?.textContent; + if (playerMetadata) { + this.playerMetadata = JSON.parse(playerMetadata); + } } // eslint-disable-next-line class-methods-use-this diff --git a/projects/player/src/html_wrapper/index.html b/projects/player/src/html_wrapper/index.html index 88f51226cffacb855594820108fb1a0d3f6bb58c..fb89dabad2f6fdd52e1bd14eb6b9119efb8db79a 100644 --- a/projects/player/src/html_wrapper/index.html +++ b/projects/player/src/html_wrapper/index.html @@ -3,44 +3,37 @@ <head> <meta charset="UTF-8"> <title>Verona Player Aspect</title> - - <meta name="application-name" content="iqb-player-aspect" - data-version="version-placeholder" - data-repository-url="https://github.com/iqb-berlin/verona-modules-apect" - data-api-version="3.0.0" - data-not-supported-api-features="" - data-supported-unit-definition-types="iqb-aspect-module@0.1.1" - data-supported-unit-state-data-types="iqb-aspect-player@0.1.1" - data-supported-browsers='{"Firefox": 69, "Chrome": 72, "Edge": 79}' - /> - <script type="application/ld+json"> + <script id="meta_data" type="application/ld+json"> { - "@context": "https://w3id.org/iqb/verona-modules", - "@type": "player", - "@id": "iqb-player-aspect", - "name": { - "de": "IQB-Player (Aspect)", - "en": "IQB player (Aspect)" - }, + "$schema": "https://raw.githubusercontent.com/verona-interfaces/metadata/master/verona-module-metadata.json", + "type": "player", + "id": "verona-player-aspect", + "version": "placeholder", + "specVersion": "4.0.0", + "name": [{ + "lang": "de", + "value": "Verona-Player (Aspect)" + }], "maintainer": { - "name": { - "de": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen", - "en": "IQB - Institute for Educational Quality Improvement" - }, + "name": [ + { + "lang": "de", + "value": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen" + } + ], "url": "https://www.iqb.hu-berlin.de", "email": "iqb-tbadev@hu-berlin.de" }, - "description": { - "de": "TODO", - "en": "TODO" - }, - "version": "version-placeholder", - "apiVersion": "3.0.0", + "description": [ + { + "lang": "de", + "value": "TODO" + } + ], "repository": { "type": "git", "url": "https://github.com/iqb-berlin/verona-modules-apect" - }, - "notSupportedFeatures": [] + } } </script> <link rel="stylesheet" href="player.css"> diff --git a/projects/player/src/index.html b/projects/player/src/index.html index 0e1173622237afb215dc14d51c9a3a79abb2afb9..d8f3cf9227d1df70d46def0b05053fa93a8ebb8e 100644 --- a/projects/player/src/index.html +++ b/projects/player/src/index.html @@ -3,15 +3,39 @@ <head> <meta charset="utf-8"> <title>Player</title> - <meta name="application-name" content="iqb-player-aspect" - data-version="0.1.0" - data-repository-url="https://github.com/iqb-berlin/verona-modules-apect" - data-api-version="3.0.0" - data-not-supported-api-features="" - data-supported-unit-definition-types="iqb-aspect-module@0.1.1" - data-supported-unit-state-data-types="iqb-aspect-player@0.1.1" - data-supported-browsers='{"Firefox": 69, "Chrome": 72, "Edge": 79}' - /> + <script id="meta_data" type="application/ld+json"> + { + "$schema": "https://raw.githubusercontent.com/verona-interfaces/metadata/master/verona-module-metadata.json", + "type": "player", + "id": "verona-player-aspect", + "version": "placeholder", + "specVersion": "4.0.0", + "name": [{ + "lang": "de", + "value": "Verona-Player (Aspect)" + }], + "maintainer": { + "name": [ + { + "lang": "de", + "value": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen" + } + ], + "url": "https://www.iqb.hu-berlin.de", + "email": "iqb-tbadev@hu-berlin.de" + }, + "description": [ + { + "lang": "de", + "value": "TODO" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/iqb-berlin/verona-modules-apect" + } + } + </script> <base href="/"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico">