From f50f0eb63d0bde1fb85395ce0d7f727f6f052f4b Mon Sep 17 00:00:00 2001 From: Walter Cruz Date: Mon, 28 Aug 2017 10:19:29 -0300 Subject: [PATCH] Adding title to the player html template --- controls.md | 1 + src/js/plyr.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/controls.md b/controls.md index 36267156..d83abbd2 100644 --- a/controls.md +++ b/controls.md @@ -37,6 +37,7 @@ You need to add several placeholders to your html template that are replaced whe - `{id}` - the dynamically generated ID for the player (for form controls) - `{seektime}` - the seek time specified in options for fast forward and rewind +- `{title}` - the title of yout media, if specified You can include only the controls you need when specifying custom html. diff --git a/src/js/plyr.js b/src/js/plyr.js index 352e0114..09d7ee7f 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1298,6 +1298,11 @@ // Replace all id references with random numbers html = _replaceAll(html, '{id}', Math.floor(Math.random() * (10000))); + // Replace Title, if it exists + if (config.title){ + html = _replaceAll(html, '{title}', config.title); + } + // Controls container var target;