Skip to content

Commit

Permalink
Merge branch 'release/3.0.1-329'
Browse files Browse the repository at this point in the history
  • Loading branch information
pyby committed Apr 23, 2020
2 parents 13ff21d + c8d47df commit c03b520
Show file tree
Hide file tree
Showing 43 changed files with 521 additions and 279 deletions.
91 changes: 66 additions & 25 deletions Application/Resources/Data/parsePlayUrl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// parsePlayUrl

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

if(! console) {
Expand Down Expand Up @@ -95,13 +95,19 @@ 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/")) {
pathname = pathname.substring(4);
}

if (hostname.includes("play-web")) {
pathname = pathname.substring(4);
pathname = pathname.replace("/stage/play", "/play");
pathname = pathname.replace("/test/play", "/play");
}

/**
* Catch special case: shared RTS media urls built by RTS MAM.
*
Expand All @@ -123,7 +129,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 @@ -159,6 +165,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
* Catch classic media urls
*
* Ex: https://www.rts.ch/play/tv/faut-pas-croire/video/exportations-darmes--la-suisse-vend-t-elle-la-guerre-ou-la-paix-?id=9938530
* Ex: https://www.srf.ch/play/tv/_/video/_?urn=urn:srf:scheduled_livestream:video:6d49170d-16e9-45ef-a8aa-00873333a610 (strange)
*/
var mediaType = null;
switch (true) {
Expand All @@ -171,9 +178,13 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
}

if (mediaType) {
var mediaUrn = queryParams["urn"];
var mediaId = queryParams["id"];
if (mediaId) {
var startTime = queryParams["startTime"];
var startTime = queryParams["startTime"];
if (mediaUrn) {
return openMediaURN(server, bu, mediaUrn, startTime);
}
else if (mediaId) {
return openMedia(server, bu, mediaType, mediaId, startTime);
}
else {
Expand Down Expand Up @@ -210,24 +221,26 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
* Catch live TV urls
*
* Ex: https://www.srf.ch/play/tv/live?tvLiveId=c49c1d73-2f70-0001-138a-15e0c4ccd3d0
* Ex: https://www.srf.ch/play/tv/live/?tvLiveId=c49c1d73-2f70-0001-138a-15e0c4ccd3d0
*/
if (pathname.endsWith("/tv/live") || pathname.endsWith("/tv/direct")) {
if (pathname.endsWith("/tv/live") || pathname.endsWith("/tv/live/") || pathname.endsWith("/tv/direct") || pathname.endsWith("/tv/direct/")) {
var mediaId = queryParams["tvLiveId"];
if (mediaId) {
return openMedia(server, bu, "video", mediaId, null);
}
else {
// Returns default TV homepage
return openTvHomePage(server,bu);
return openTvHomePage(server, bu);
}
}

/**
* Catch live radio urls
*
* Ex: https://www.rsi.ch/play/radio/livepopup/rete-uno
* Ex: https://www.rsi.ch/play/radio/legacy-livepopup/rete-uno
*/
if (pathname.includes("/radio/livepopup/")) {
if (pathname.includes("/radio/livepopup/") || pathname.includes("/radio/legacy-livepopup/")) {
var mediaBu = null;
var mediaId = null;
switch (pathname.substr(pathname.lastIndexOf('/') + 1)) {
Expand Down Expand Up @@ -299,7 +312,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 +323,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 @@ -340,15 +369,18 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {
}

/**
* Catch redirect show urls
* Catch redirect and simple show urls
*
* Ex: https://www.rts.ch/play/tv/quicklink/6176
* Ex: https://www.rts.ch/play/tv/show/9674517
*/
switch (true) {
case pathname.includes("/tv/quicklink/"):
case pathname.includes("/tv/show/"):
showTransmission = "tv";
break;
case pathname.includes("/radio/quicklink/"):
case pathname.includes("/radio/show/"):
showTransmission = "radio";
break;
}
Expand All @@ -369,7 +401,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 +411,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 +508,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 +525,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 +536,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 +553,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,19 +564,20 @@ 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);
}

/**
* Catch play help urls
*
* Ex: https://www.srf.ch/play/tv/hilfe
* Ex: https://www.srf.ch/play/tv/hilfe/geoblock
* Ex: https://www.rts.ch/play/tv/aide
* Ex: https://www.rsi.ch/play/tv/guida
* Ex: https://www.rtr.ch/play/tv/agid
* Ex: https://play.swissinfo.ch/play/tv/help
*/
if (pathname.endsWith("/hilfe") || pathname.endsWith("/aide") || pathname.endsWith("/guida") || pathname.endsWith("/agid") || pathname.endsWith("/help")) {
if (pathname.endsWith("/hilfe") || pathname.includes("/hilfe/") || pathname.endsWith("/aide") || pathname.includes("/aide/") || pathname.endsWith("/guida") || pathname.includes("/guida/") || pathname.endsWith("/agid") || pathname.includes("/agid/") || pathname.endsWith("/help") || pathname.includes("/help/")) {
return openURL(server, bu, scheme, hostname, pathname, queryParams, anchor);
}

Expand All @@ -557,7 +590,7 @@ function parseForPlayApp(scheme, hostname, pathname, queryParams, anchor) {

function openMedia(server, bu, mediaType, mediaId, startTime) {
var urn="urn:" + bu + ":" + mediaType + ":" + mediaId;
return openMediaURN(server,bu,urn,startTime);
return openMediaURN(server, bu, urn, startTime);
}

function openMediaURN(server, bu, mediaURN, startTime) {
Expand Down Expand Up @@ -777,22 +810,30 @@ function serverForUrl(hostname, pathname, queryParams) {
}
}
}
else if (hostname.includes("play-web")) {
if (pathname.includes("/stage/play")) {
server = "stage";
}
else if (pathname.includes("/test/play")) {
server = "test";
}
}
return server;
}

function getBuFromHostname(hostname, pathname) {
switch (true) {
case hostname.endsWith("tp.srgssr.ch") || hostname.endsWith("player.rts.ch") || hostname.endsWith("player.rsi.ch") || hostname.endsWith("player.rtr.ch") || hostname.endsWith("player.swissinfo.ch") || hostname.endsWith("player.srf.ch"):
return "tp";
case hostname.includes("rts.ch") || hostname.includes("srgplayer-rts") || (hostname.includes("play-mmf") && pathname.startsWith("/rts/")):
case hostname.includes("rts.ch") || hostname.includes("srgplayer-rts") || (hostname.includes("play-mmf") && pathname.startsWith("/rts/")) || (hostname.includes("play-web") && pathname.startsWith("/rts/")):
return "rts";
case hostname.includes("rsi.ch") || hostname.includes("srgplayer-rsi") || (hostname.includes("play-mmf") && pathname.startsWith("/rsi/")):
case hostname.includes("rsi.ch") || hostname.includes("srgplayer-rsi") || (hostname.includes("play-mmf") && pathname.startsWith("/rsi/")) || (hostname.includes("play-web") && pathname.startsWith("/rsi/")):
return "rsi";
case hostname.includes("rtr.ch") || hostname.includes("srgplayer-rtr") || (hostname.includes("play-mmf") && pathname.startsWith("/rtr/")):
case hostname.includes("rtr.ch") || hostname.includes("srgplayer-rtr") || (hostname.includes("play-mmf") && pathname.startsWith("/rtr/")) || (hostname.includes("play-web") && pathname.startsWith("/rtr/")):
return "rtr";
case hostname.includes("swissinfo.ch") || hostname.includes("srgplayer-swi") || (hostname.includes("play-mmf") && pathname.startsWith("/swi/")):
case hostname.includes("swissinfo.ch") || hostname.includes("srgplayer-swi") || (hostname.includes("play-mmf") && pathname.startsWith("/swi/")) || (hostname.includes("play-web") && pathname.startsWith("/swi/")):
return "swi";
case hostname.includes("srf.ch") || hostname.includes("srgplayer-srf") || (hostname.includes("play-mmf") && pathname.startsWith("/srf/")):
case hostname.includes("srf.ch") || hostname.includes("srgplayer-srf") || (hostname.includes("play-mmf") && pathname.startsWith("/srf/")) || (hostname.includes("play-web") && pathname.startsWith("/srf/")):
return "srf";
case hostname.includes("play-mmf") && pathname.startsWith("/mmf/"):
return "mmf";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ name: UrbanAirship-iOS-SDK, nameSpecified:
body: Copyright 2017 Urban…
version: 9.4.0

name: appcenter-sdk-apple, nameSpecified: , owner: microsoft, version: 2.5.3
name: appcenter-sdk-apple, nameSpecified: , owner: microsoft, version: 3.1.1

name: CoconutKit, nameSpecified: , owner: defagos, version: 3.4

Expand All @@ -466,27 +466,27 @@ name: Mantle, nameSpecified: , owner: Mantle, version: 2.1.0

name: Masonry, nameSpecified: , owner: SRGSSR, version: v1.1.0_srg1

name: srganalytics-apple, nameSpecified: , owner: SRGSSR, version: 4.1.0
name: srganalytics-apple, nameSpecified: , owner: SRGSSR, version: 4.1.1

name: srgappearance-apple, nameSpecified: , owner: SRGSSR, version: 2.0.0
name: srgappearance-apple, nameSpecified: , owner: SRGSSR, version: 2.1.0

name: srgcontentprotection-apple, nameSpecified: , owner: SRGSSR, version: 2.0.1

name: srgdataprovider-apple, nameSpecified: , owner: SRGSSR, version: 7.0.1
name: srgdataprovider-apple, nameSpecified: , owner: SRGSSR, version: 7.1.0

name: srgdiagnostics-apple, nameSpecified: , owner: SRGSSR, version: 2.0.1

name: srgidentity-apple, nameSpecified: , owner: SRGSSR, version: 2.0.1
name: srgidentity-apple, nameSpecified: , owner: SRGSSR, version: 2.0.2

name: srgletterbox-apple, nameSpecified: , owner: SRGSSR, version: 3.0.1
name: srgletterbox-apple, nameSpecified: , owner: SRGSSR, version: 4.0.0

name: srglogger-apple, nameSpecified: , owner: SRGSSR, version: 2.0.0

name: srgmediaplayer-apple, nameSpecified: , owner: SRGSSR, version: 4.0.0

name: srgnetwork-apple, nameSpecified: , owner: SRGSSR, version: 2.0.1

name: srguserdata-apple, nameSpecified: , owner: SRGSSR, version: 2.0.1
name: srguserdata-apple, nameSpecified: , owner: SRGSSR, version: 2.0.2

name: tagcommander-apple, nameSpecified: , owner: SRGSSR, version: 4.5.4_4.4.1_srg3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<key>File</key>
<string>com.mono0926.LicensePlist/appcenter-sdk-apple</string>
<key>Title</key>
<string>appcenter-sdk-apple (2.5.3)</string>
<string>appcenter-sdk-apple (3.1.1)</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
Expand Down Expand Up @@ -232,15 +232,15 @@
<key>File</key>
<string>com.mono0926.LicensePlist/srganalytics-apple</string>
<key>Title</key>
<string>srganalytics-apple (4.1.0)</string>
<string>srganalytics-apple (4.1.1)</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
<dict>
<key>File</key>
<string>com.mono0926.LicensePlist/srgappearance-apple</string>
<key>Title</key>
<string>srgappearance-apple (2.0.0)</string>
<string>srgappearance-apple (2.1.0)</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
Expand All @@ -256,7 +256,7 @@
<key>File</key>
<string>com.mono0926.LicensePlist/srgdataprovider-apple</string>
<key>Title</key>
<string>srgdataprovider-apple (7.0.1)</string>
<string>srgdataprovider-apple (7.1.0)</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
Expand All @@ -272,15 +272,15 @@
<key>File</key>
<string>com.mono0926.LicensePlist/srgidentity-apple</string>
<key>Title</key>
<string>srgidentity-apple (2.0.1)</string>
<string>srgidentity-apple (2.0.2)</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
<dict>
<key>File</key>
<string>com.mono0926.LicensePlist/srgletterbox-apple</string>
<key>Title</key>
<string>srgletterbox-apple (3.0.1)</string>
<string>srgletterbox-apple (4.0.0)</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
Expand Down Expand Up @@ -312,7 +312,7 @@
<key>File</key>
<string>com.mono0926.LicensePlist/srguserdata-apple</string>
<key>Title</key>
<string>srguserdata-apple (2.0.1)</string>
<string>srguserdata-apple (2.0.2)</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
Expand Down
3 changes: 3 additions & 0 deletions Application/Sources/Application/PlayAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ - (void)setupAppCenter

return YES;
}];

MSDistribute.updateTrack = MSUpdateTrackPrivate;

[MSAppCenter start:appCenterSecret withServices:@[ MSCrashes.class, MSDistribute.class ]];
}

Expand Down
Loading

0 comments on commit c03b520

Please sign in to comment.