Skip to content

Commit 6607dad

Browse files
authored
Merge pull request #14 from SpringRoll/feature/play-options-via-query-string
Feature/play options via query string
2 parents e7af5ba + ab470c4 commit 6607dad

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

dist/container.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,24 @@
14501450
plugins[i].open.call(this);
14511451
}
14521452

1453+
// append a query parameter to pass play options
1454+
if (options.playOptions !== null)
1455+
{
1456+
var playOptionsQueryString = 'playOptions=' + window.encodeURIComponent(JSON.stringify(options.playOptions));
1457+
1458+
// if there isn't a query string yet, add the question mark
1459+
if (path.indexOf('?') === -1)
1460+
{
1461+
path += '?' + playOptionsQueryString;
1462+
}
1463+
1464+
// otherwise, there already is a query string, so preserve it by appending a new variable
1465+
else
1466+
{
1467+
path += '&' + playOptionsQueryString;
1468+
}
1469+
}
1470+
14531471
//Open the application in the iframe
14541472
this.main.classList.add('loading');
14551473
this.main.setAttribute('src', path);

0 commit comments

Comments
 (0)