VID-9: Write microdata into page as well as player



Issue Information

Issue Type: New Feature
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: Videos.bentasker.co.uk (VID)
Resolution: Done (2019-04-02 17:39:19)
Target version: v0.13,
Components: Embed Code ,

Created: 2019-04-02 11:33:07
Time Spent Working


Description
As VID-8 implements a basic player page, we now have some basic metadata which could also be embedded into pages for the benefit of search engines (or, at least, those like Google which take changes made by JS into account).

The idea of this feature is to have the embed script write in some schema.org markup.

At the very least we should be able to fetch details.json (see VID-8) for the embedded file, and if it exists write in

- name
- url (link to the player page)
- description
- keywords
- playerType (html5)





Toggle State Changes

Activity


Repo: videos.bentasker.co.uk
Host:Rimmer

commit c38ed833504f845182df4d904fa1d1c7bbb5aa42
Author: B Tasker <github@<Domain Hidden>>
Date: Tue Apr 2 17:23:28 2019 +0100

Commit Message: VID-9 Write basic schema.org markup into pages when embedding

Will only get used by search engines that execute the JS, but that was a given anyway (as the video won't be embedded if JS isn't active)

resources/embed/embed.js | 72 +++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 71 insertions(+), 1 deletions(-)


View Commit | View Changes
Repo: videos.bentasker.co.uk
Host:Rimmer

commit 75e2ef309b32019cfe0fa619784cd9b6dac512f2
Author: B Tasker <github@<Domain Hidden>>
Date: Tue Apr 2 17:35:53 2019 +0100

Commit Message: VID-9 For some reason it doesn't particularly like being embedded in the Player page

It complains that storage isn't defined. Can't currently see why, but this is a relatively unimportant feature so for now just bailing if that situation arises

resources/embed/embed.js | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)


View Commit | View Changes
This now implemented, and the following HTML gets embedded
<meta itemprop="url" content="https://videos.bentasker.co.uk/Player.html?url=2017%2F20170111-noisy-bearing%2Fdetails.json">
<meta itemprop="name" content="Noisy Alternator Bearing">
<meta itemprop="description" content="Bearing noise from the alternator of a Volvo S60">
<meta itemprop="keywords" content="Vehicle,alternator,failing bearing,volvo">
<meta itemprop="playerType" content="html5">


It also sanely handles missing keys in the JSON
btasker changed status from 'Open' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'