Skip to content

Commit

Permalink
Merge pull request #38 from SRGSSR/develop
Browse files Browse the repository at this point in the history
Update ParsePlayUrl javascript version
  • Loading branch information
pyby authored Oct 4, 2019
2 parents eb9a295 + af193f4 commit 5895dd4
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 16 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>17</version>
<version>18</version>
<packaging>jar</packaging>

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

var parsePlayUrlVersion = 21;
var parsePlayUrlVersion = 22;
var parsePlayUrlBuild = "mmf";

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

/**
* Catch live tv popup urls
* Catch tv video popup urls
*
* Ex: https://www.srf.ch/play/tv/popupvideoplayer?id=b833a5af-63c6-4310-bb80-05341310a4f5
*/
Expand All @@ -342,6 +342,22 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
}
}

/**
* Catch radio audio popup urls
*
* Ex: https://www.srf.ch/play/radio/popupaudioplayer?id=dc5e9465-ac64-409a-9878-ee47de3d1346
*/
if (pathname.includes("/radio/popupaudioplayer")) {
var mediaId = queryParams["id"];
if (mediaId) {
return openMedia(server, bu, "audio", mediaId, null);
}
else {
// Returns default TV homepage
return openPage(server, bu, "radio:home", null, null);
}
}

/**
* Catch classic show urls
*
Expand Down
42 changes: 29 additions & 13 deletions src/main/resources/deeplink/v2/parsePlayUrl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// parsePlayUrl

var parsePlayUrlVersion = 21;
var parsePlayUrlVersion = 22;
var parsePlayUrlBuild = "mmf";

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

// Returns default TV homepage
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}

if (hostname.includes("play-mmf") && ! pathname.startsWith("/mmf/")) {
Expand Down Expand Up @@ -123,7 +123,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
}
else if (pathname.startsWith("/video")) {
// Returns default TV homepage
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}
else {
var channelId = null;
Expand Down Expand Up @@ -218,7 +218,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
}
else {
// Returns default TV homepage
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}
}

Expand Down Expand Up @@ -299,7 +299,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
}

/**
* Catch live tv popup urls
* Catch tv video popup urls
*
* Ex: https://www.srf.ch/play/tv/popupvideoplayer?id=b833a5af-63c6-4310-bb80-05341310a4f5
*/
Expand All @@ -310,7 +310,23 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
}
else {
// Returns default TV homepage
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}
}

/**
* Catch radio audio popup urls
*
* Ex: https://www.srf.ch/play/radio/popupaudioplayer?id=dc5e9465-ac64-409a-9878-ee47de3d1346
*/
if (pathname.includes("/radio/popupaudioplayer")) {
var mediaId = queryParams["id"];
if (mediaId) {
return openMedia(server, bu, "audio", mediaId, null);
}
else {
// Returns default radio homepage
return openRadioHomePage(server, bu, null);
}
}

Expand Down Expand Up @@ -369,7 +385,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
* Ex: https://www.srf.ch/play/tv
*/
if (pathname.endsWith("/tv")) {
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}

/**
Expand All @@ -379,7 +395,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
*/
if (pathname.endsWith("/radio")) {
var channelId = queryParams["station"];
return openRadioHomePage(server, bu,channelId);
return openRadioHomePage(server, bu, channelId);
}

/**
Expand Down Expand Up @@ -476,7 +492,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
* Ex: https://www.rts.ch/play/tv/categories/info
*/
if (pathname.endsWith("/tv/themen") || pathname.endsWith("/tv/categories") || pathname.endsWith("/tv/categorie") || pathname.endsWith("/tv/tematicas") || pathname.endsWith("/tv/topics")) {
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}
else if (pathname.includes("/tv/themen") || pathname.includes("/tv/categories") || pathname.includes("/tv/categorie") || pathname.includes("/tv/tematicas") || pathname.includes("/tv/topics")) {
var lastPathComponent = pathname.split("/").slice(-1)[0];
Expand All @@ -493,7 +509,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
return openTopic(server, bu, "tv", topicId);
}
else {
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}
}

Expand All @@ -504,7 +520,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
*. Ex: https://www.rsi.ch/play/tv/event/event-playrsi-8858482
*/
if (pathname.endsWith("/tv/event")) {
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}
else if (pathname.includes("/tv/event")) {
var lastPathComponent = pathname.split("/").slice(-1)[0];
Expand All @@ -521,7 +537,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
return openModule(server, bu, "event", eventId);
}
else {
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}
}

Expand All @@ -532,7 +548,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
*. Ex: https://www.rsi.ch/play
*/
if (pathname.endsWith("/play/") || pathname.endsWith("/play")) {
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}

/**
Expand Down

0 comments on commit 5895dd4

Please sign in to comment.