Skip to content

Commit

Permalink
added logic to redirect according to the preferred view.
Browse files Browse the repository at this point in the history
  • Loading branch information
feriel97 committed Feb 12, 2025
1 parent b0a2c43 commit b2d34e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web/template/partial/stream/actions.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{{if $stream.PlaylistUrl}}
<a class="text-left flex justify-start items-center w-full text-3 px-4 py-2 hover:cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600"
title="Combined view"
@click="watch.switchView('/w/{{$course.Slug}}/{{$stream.Model.ID}}')">
@click="watch.switchView('/w/{{$course.Slug}}/{{$stream.Model.ID}}/COMB')">
<i class="text-lg fas fa-object-group text-4 hover:text-1 w-8"></i>
<span class="font-light text-sm">Combined view</span>
</a>
Expand Down
15 changes: 15 additions & 0 deletions web/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@ func (r mainRoutes) WatchPage(c *gin.Context) {
}
}

if c.Param("version") == "" {
switch tumLiveContext.User.GetPreferredView() {
case "Presentation":

c.Redirect(http.StatusFound, c.Request.RequestURI+"/PRES")

case "Camera":
c.Redirect(http.StatusFound, c.Request.RequestURI+"/CAM")
case "Combined":
c.Redirect(http.StatusFound, c.Request.RequestURI+"/COMB")
case "Split":
c.Redirect(http.StatusFound, c.Request.RequestURI+"/SPLIT")
}
}

// Check for fetching progress
if tumLiveContext.User != nil && tumLiveContext.Stream.Recording {

Expand Down

0 comments on commit b2d34e8

Please sign in to comment.