From 09df930720126f58efea7848b4f2162b3c9f6666 Mon Sep 17 00:00:00 2001
From: Daniel Haag <daniel.haag@uibk.ac.at>
Date: Thu, 20 Feb 2020 09:42:45 +0100
Subject: [PATCH] openolat#46: change stream1/2 to presenter/presentation to
 fix defaultProfile problem

---
 .../livestream/paella/PaellaFactory.java      | 20 +++++++++----------
 .../livestream/paella/PlayerProfile.java      | 20 +++++++++----------
 .../ui/LiveStreamViewersController.java       |  2 +-
 .../ui/_i18n/LocalStrings_de.properties       |  4 ++--
 .../ui/_i18n/LocalStrings_en.properties       |  4 ++--
 .../ui/_i18n/LocalStrings_fr.properties       |  4 ++--
 6 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/src/main/java/org/olat/course/nodes/livestream/paella/PaellaFactory.java b/src/main/java/org/olat/course/nodes/livestream/paella/PaellaFactory.java
index af8c7f3b90a..ebbf012a6bc 100644
--- a/src/main/java/org/olat/course/nodes/livestream/paella/PaellaFactory.java
+++ b/src/main/java/org/olat/course/nodes/livestream/paella/PaellaFactory.java
@@ -27,13 +27,13 @@ import org.olat.core.util.StringHelper;
 import org.olat.course.nodes.livestream.LiveStreamModule;
 
 /**
- * 
+ *
  * Initial date: 13 Dec 2019<br>
  * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
  *
  */
 public class PaellaFactory {
-	
+
 	public static Streams createStreams(String url) {
 		Streams streams = new Streams();
 		if (StringHelper.containsNonWhitespace(url)) {
@@ -47,16 +47,16 @@ public class PaellaFactory {
 		String urlSeparator = CoreSpringFactory.getImpl(LiveStreamModule.class).getUrlSeparator();
 		return url.split(urlSeparator);
 	}
-	
+
 	private static void addStreams(Streams streams, String[] urls) {
 		List<Stream> streamList = new ArrayList<>(2);
 		if (urls.length > 0) {
-			Stream stream1 = createStream("stream1", urls[0]);
-			streamList.add(stream1);
+			Stream presenter = createStream("presenter", urls[0]);
+			streamList.add(presenter);
 		}
 		if (urls.length > 1) {
-			Stream stream1 = createStream("stream2", urls[1]);
-			streamList.add(stream1);
+			Stream presenter = createStream("presentation", urls[1]);
+			streamList.add(presenter);
 		}
 		Stream[] streamArray = streamList.toArray(new Stream[streamList.size()]);
 		streams.setStreams(streamArray);
@@ -75,11 +75,11 @@ public class PaellaFactory {
 		addSource(sources, url);
 		return sources;
 	}
-	
+
 	private static void addSource(Sources sources, String url) {
 		String suffix = getSuffix(url);
 		if (suffix == null) return;
-	
+
 		switch (suffix) {
 		case "m3u8":
 			addM3U8Source(sources, url);
@@ -96,7 +96,7 @@ public class PaellaFactory {
 		Source source = createSource(url);
 		sources.setHls(new Source[] {source});
 	}
-	
+
 	private static void addMP4Source(Sources sources, String url) {
 		Source source = createSource(url);
 		sources.setMp4(new Source[] {source});
diff --git a/src/main/java/org/olat/course/nodes/livestream/paella/PlayerProfile.java b/src/main/java/org/olat/course/nodes/livestream/paella/PlayerProfile.java
index 707fed01afb..801c7cff270 100644
--- a/src/main/java/org/olat/course/nodes/livestream/paella/PlayerProfile.java
+++ b/src/main/java/org/olat/course/nodes/livestream/paella/PlayerProfile.java
@@ -22,53 +22,53 @@ package org.olat.course.nodes.livestream.paella;
 import org.olat.core.gui.render.StringOutput;
 
 /**
- * 
+ *
  * Initial date: 17 Dec 2019<br>
  * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
  *
  */
 public enum PlayerProfile {
-	
+
 	both("player.profile.both") {
 		@Override
 		public void appendPlayerConfig(StringOutput sb) {
 			sb.append("      'es.upv.paella.singleStreamProfilePlugin': {");
 			sb.append("          'enabled': true,");
 			sb.append("          'videoSets': [");
-			sb.append("            { 'icon':'professor_icon.svg', 'id':'professor', 'content':['stream1']},");
-			sb.append("            { 'icon':'slide_icon.svg', 'id':'slide', 'content':['stream2']}");
+			sb.append("            { 'icon':'professor_icon.svg', 'id':'professor', 'content':['presenter']},");
+			sb.append("            { 'icon':'slide_icon.svg', 'id':'slide', 'content':['presentation']}");
 			sb.append("          ]");
 			sb.append("      },");
 			sb.append("      'es.upv.paella.dualStreamProfilePlugin': { 'enabled':true,");
 			sb.append("        'videoSets': [");
-			sb.append("          { 'icon':'slide_professor_icon.svg', 'id':'slide_over_professor', 'content':['stream1','stream2'] }");
+			sb.append("          { 'icon':'slide_professor_icon.svg', 'id':'slide_over_professor', 'content':['presenter','presentation'] }");
 			sb.append("        ]");
 			sb.append("      },");
 		}
 	},
-	stream1("player.profile.stream1") {
+	presenter("player.profile.presenter") {
 		@Override
 		public void appendPlayerConfig(StringOutput sb) {
 			sb.append("      'es.upv.paella.singleStreamProfilePlugin': {");
 			sb.append("          'enabled': true,");
 			sb.append("          'videoSets': [");
-			sb.append("            { 'icon':'professor_icon.svg', 'id':'professor', 'content':['stream1']}");
+			sb.append("            { 'icon':'professor_icon.svg', 'id':'professor', 'content':['presenter']}");
 			sb.append("          ]");
 			sb.append("      },");
 		}
 	},
-	stream2("player.profile.stream2") {
+	presentation("player.profile.presentation") {
 		@Override
 		public void appendPlayerConfig(StringOutput sb) {
 			sb.append("      'es.upv.paella.singleStreamProfilePlugin': {");
 			sb.append("          'enabled': true,");
 			sb.append("          'videoSets': [");
-			sb.append("            { 'icon':'slide_icon.svg', 'id':'slide', 'content':['stream2']}");
+			sb.append("            { 'icon':'slide_icon.svg', 'id':'slide', 'content':['presentation']}");
 			sb.append("          ]");
 			sb.append("      },");
 		}
 	};
-	
+
 	private final String i18nKey;
 
 	private PlayerProfile(String i18nKey) {
diff --git a/src/main/java/org/olat/course/nodes/livestream/ui/LiveStreamViewersController.java b/src/main/java/org/olat/course/nodes/livestream/ui/LiveStreamViewersController.java
index 366558f124a..7b68aaf5c7d 100644
--- a/src/main/java/org/olat/course/nodes/livestream/ui/LiveStreamViewersController.java
+++ b/src/main/java/org/olat/course/nodes/livestream/ui/LiveStreamViewersController.java
@@ -142,7 +142,7 @@ public class LiveStreamViewersController extends BasicController {
 	}
 	
 	private PlayerProfile getPlayerProfile(ModuleConfiguration moduleConfiguration) {
-		PlayerProfile playerProfile = PlayerProfile.stream1;
+		PlayerProfile playerProfile = PlayerProfile.presentation;
 		
 		if (liveStreamModule.isMultiStreamEnabled()) {
 			String nodePlayerProfile = moduleConfiguration.getStringValue(LiveStreamCourseNode.CONFIG_PLAYER_PROFILE);
diff --git a/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_de.properties
index bc2a803cfa8..b2441fa0ae6 100644
--- a/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_de.properties
+++ b/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_de.properties
@@ -27,8 +27,8 @@ peekview.open.upcoming=Alle anzeigen
 peekview.title.live=Jetzt live: {0}
 peekview.title.upcoming=Demn\u00E4chst: {0}
 player.profile.both=Beide Streams anzeigen
-player.profile.stream1=Stream 1 anzeigen
-player.profile.stream2=Stream 2 anzeigen
+player.profile.presenter=Vortragende anzeigen
+player.profile.presentation=Content anzeigen
 run.edit.events=Termine bearbeiten
 run.statistic=Statistik
 run.streams=Live Streams
diff --git a/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_en.properties
index a4e187294fb..7f901113a8a 100644
--- a/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_en.properties
+++ b/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_en.properties
@@ -27,8 +27,8 @@ peekview.open.upcoming=Show all
 peekview.title.live=Live: {0}
 peekview.title.upcoming=Upcoming: {0}
 player.profile.both=Show both streams
-player.profile.stream1=Show stream 1
-player.profile.stream2=Show stream 2
+player.profile.presenter=Show presenter stream
+player.profile.presentation=Show content stream
 run.edit.events=Edit events
 run.statistic=Statistic
 run.streams=Livestreams
diff --git a/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_fr.properties
index 6176341e0d1..814c17df2be 100644
--- a/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_fr.properties
+++ b/src/main/java/org/olat/course/nodes/livestream/ui/_i18n/LocalStrings_fr.properties
@@ -28,8 +28,8 @@ peekview.open.upcoming=Tout afficher
 peekview.title.live=En direct\: {0}
 peekview.title.upcoming=Prochainement\: {0}
 player.profile.both=Montrer les deux flux
-player.profile.stream1=Montrer le flux 1
-player.profile.stream2=Montrer le flux 2
+player.profile.presenter=Montrer le flux de lecture
+player.profile.presentation=Montrer le flux de presentation
 run.edit.events=Editer les rendez-vous
 run.statistic=Statistique
 run.streams=Diffusions en direct
-- 
GitLab