Mercurial > hg > webaudioevaluationtool
changeset 2491:2305ef6779fe
Added video support #134
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Thu, 25 Aug 2016 10:45:10 +0100 |
parents | 4c83eaacf002 |
children | f0b0809c7ee5 |
files | css/core.css js/core.js xml/test-schema.xsd |
diffstat | 3 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/css/core.css Mon Aug 08 14:26:35 2016 +0200 +++ b/css/core.css Thu Aug 25 10:45:10 2016 +0100 @@ -51,6 +51,12 @@ overflow: auto; } +div#popupContent iframe { + width: 100%; + border: 0px none; + height: 290px; +} + div#popupTitleHolder { width: inherit; min-height: 25px;
--- a/js/core.js Mon Aug 08 14:26:35 2016 +0200 +++ b/js/core.js Thu Aug 25 10:45:10 2016 +0100 @@ -810,7 +810,16 @@ this.popupResponse.appendChild(input); this.popupResponse.style.textAlign="center"; this.popupResponse.style.left="0%"; - } + } else if (node.specification.type == "video") { + var video = document.createElement("video"); + video.src = node.specification.url; + this.popupResponse.appendChild(video); + } else if (node.specification.type == "youtube") { + var iframe = document.createElement("iframe"); + iframe.className = "youtube"; + iframe.src = node.specification.url; + this.popupResponse.appendChild(iframe); + } if(this.currentIndex+1 == this.popupOptions.length) { if (this.node.location == "pre") { this.buttonProceed.textContent = 'Start';
--- a/xml/test-schema.xsd Mon Aug 08 14:26:35 2016 +0200 +++ b/xml/test-schema.xsd Thu Aug 25 10:45:10 2016 +0100 @@ -280,6 +280,8 @@ <xs:enumeration value="number" /> <xs:enumeration value="radio" /> <xs:enumeration value="checkbox" /> + <xs:enumeration value="video" /> + <xs:enumeration value="youtube" /> </xs:restriction> </xs:simpleType> </xs:attribute> @@ -293,6 +295,7 @@ </xs:restriction> </xs:simpleType> </xs:attribute> + <xs:attribute name="url" type="xs:string" use="optional"/> </xs:complexType> </xs:element> </xs:sequence>