diff --git a/resources/embed/embed.js b/resources/embed/embed.js
--- a/resources/embed/embed.js
+++ b/resources/embed/embed.js
#
@@ -50,7 +50,7 @@ function embedBensPlayer(vidurl,vidtype){
#
- playerSettings = { 'vidtype': vidtype, 'vidurl': vidurl}
#
+ playerSettings = { 'vidtype': vidtype, 'vidurl': vidurl, 'vidid': vidid}
#
// We then trigger the next steps in stages to make sure everything that needs to be loaded, is
#
@@ -105,6 +105,10 @@ function writePlayer(vidid,playerSettings){
#
+ // VID-9 check for metadata and write schema.org markup if it exists
#
+ dirname = playerSettings['vidurl'].match(/.*\//);
#
+ fetchPage(dirname + 'details.json',BenswriteSchemaOrg,function(e){},playerSettings);
#
@@ -134,3 +138,69 @@ function loadVJSHLS(vidid,playerSettings){
#
+function fetchPage(url,callback,errcallback,storage){
#
+ if (window.XMLHttpRequest){
#
+ // code for IE7+, Firefox, Chrome, Opera, Safari
#
+ xmlhttp=new XMLHttpRequest();
#
+ // code for IE6, IE5 (why am I still supporting these? Die... Die.... Die....
#
+ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
#
+ xmlhttp.onreadystatechange=function(){
#
+ if (xmlhttp.readyState==4){
#
+ if(xmlhttp.status==200){
#
+ callback(xmlhttp.responseText,storage,url)
#
+ errcallback(xmlhttp.responseText)
#
+ xmlhttp.open("GET",url,true);
#
+function BenswriteSchemaOrg(text,storage,url){
#
+ var j = JSON.parse(text);
#
+ var d = document.getElementById('BensplayerWrapper'+storage['vidid']);
#
+ d.setAttribute('itemscope','');
#
+ d.setAttribute('itemtype','https://schema.org/VideoObject');
#
+ var url = 'https://videos.bentasker.co.uk/Player.html?url=' + encodeURIComponent(url.replace('https://videos.bentasker.co.uk/',''));
#
+ m.setAttribute('itemprop','url');
#
+ m.setAttribute('content', url);
#
+ if (j.hasOwnProperty('title')){
#
+ m.setAttribute('itemprop','name');
#
+ m.setAttribute('content',j['title']);
#
+ if (j.hasOwnProperty('description')){
#
+ m.setAttribute('itemprop','description');
#
+ m.setAttribute('content',j['description'].replace(/'/g, ''));
#
+ if (j.hasOwnProperty('keywords')){
#
+ m.setAttribute('itemprop','keywords');
#
+ m.setAttribute('content',j['keywords'].replace(/'/g, ''));
#
+ m.setAttribute('itemprop','playerType');
#
+ m.setAttribute('content','html5');
#
\ No newline at end of file