Skip to content

Commit

Permalink
Merge pull request #48 from SRGSSR/develop
Browse files Browse the repository at this point in the history
Update ParsePlayUrl javascript version to v26
  • Loading branch information
pyby authored Aug 4, 2020
2 parents 4970d50 + a837dd1 commit 8b0a71d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>ch.srgssr</groupId>
<artifactId>playfff</artifactId>
<version>25</version>
<version>26</version>
<packaging>jar</packaging>

<name>pfff</name>
Expand Down
30 changes: 29 additions & 1 deletion src/main/resources/deeplink/v1/parsePlayUrl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// parsePlayUrl

var parsePlayUrlVersion = 25;
var parsePlayUrlVersion = 26;
var parsePlayUrlBuild = "mmf";

if(! console) {
Expand Down Expand Up @@ -252,6 +252,24 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
}
}

/**
* Catch embed media urls
*
* Ex: https://www.rts.ch/play/embed?urn=urn:rts:video:580545
* Ex: https://www.rts.ch/play/embed?urn=urn:rts:video:580545&startTime=60
*/
if (pathname.endsWith("/embed")) {
var mediaURN = queryParams["urn"];
if (mediaURN) {
var startTime = queryParams["startTime"];
return openMediaURN(server, bu, mediaURN, startTime);
}
else {
// Returns default TV homepage
return openTvHomePage(server, bu);
}
}

/**
* Catch live TV urls
*
Expand Down Expand Up @@ -609,6 +627,16 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
return openPage(server, bu, "tv:home", null, null);
}

/**
* Catch legacy bowser urls
*
* Ex: https://www.srf.ch/play/legacy-browser
*. Ex: https://www.rsi.ch/play/legacy-browser
*/
if (pathname.endsWith("/legacy-browser")) {
return openPage(server, bu, "tv:home", null, null);
}

/**
* Catch play help urls
*
Expand Down
30 changes: 29 additions & 1 deletion src/main/resources/deeplink/v2/parsePlayUrl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// parsePlayUrl

var parsePlayUrlVersion = 25;
var parsePlayUrlVersion = 26;
var parsePlayUrlBuild = "mmf";

if(! console) {
Expand Down Expand Up @@ -224,6 +224,24 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
}
}

/**
* Catch embed media urls
*
* Ex: https://www.rts.ch/play/embed?urn=urn:rts:video:580545
* Ex: https://www.rts.ch/play/embed?urn=urn:rts:video:580545&startTime=60
*/
if (pathname.endsWith("/embed")) {
var mediaURN = queryParams["urn"];
if (mediaURN) {
var startTime = queryParams["startTime"];
return openMediaURN(server, bu, mediaURN, startTime);
}
else {
// Returns default TV homepage
return openTvHomePage(server, bu);
}
}

/**
* Catch live TV urls
*
Expand Down Expand Up @@ -574,6 +592,16 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
return openTvHomePage(server, bu);
}

/**
* Catch legacy bowser urls
*
* Ex: https://www.srf.ch/play/legacy-browser
*. Ex: https://www.rsi.ch/play/legacy-browser
*/
if (pathname.endsWith("/legacy-browser")) {
return openTvHomePage(server, bu);
}

/**
* Catch play help urls
*
Expand Down

0 comments on commit 8b0a71d

Please sign in to comment.