Skip to content

Commit

Permalink
Change player to flowplayer
Browse files Browse the repository at this point in the history
- old player is still available under `/clappr/:id`
  • Loading branch information
rabilrbl committed Aug 30, 2023
1 parent 9eb558e commit da4fe8d
Show file tree
Hide file tree
Showing 10 changed files with 2,823 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/jiotv_go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func main() {
r.GET("/channels", handlers.ChannelsHandler)
r.GET("/play/:id", handlers.PlayHandler)
r.GET("/player/:id", handlers.PlayerHandler)
r.GET("/clapper/:id", handlers.ClapprHandler)

if len(os.Args) > 1 {
r.Run(os.Args[1])
Expand Down
2,489 changes: 2,489 additions & 0 deletions cmd/jiotv_go/static/flowplayer.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cmd/jiotv_go/static/flowplayer.min.js

Large diffs are not rendered by default.

280 changes: 280 additions & 0 deletions cmd/jiotv_go/static/hls.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cmd/jiotv_go/static/keyboard.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmd/jiotv_go/static/qsel.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
39 changes: 39 additions & 0 deletions cmd/jiotv_go/templates/flow_player.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JioTV Go</title>
<style>
body {
margin: 0;
padding: 0;
background-color: black;
overflow-y: hidden;
}
</style>
<link rel="stylesheet" href="/static/flowplayer.css">
<script src="/static/flowplayer.min.js"></script>
<script src="/static/hls.min.js"></script>
<script src="/static/qsel.min.js"></script>
<script src="/static/keyboard.min.js"></script>
</head>

<body>
<div id="jiotv_go_player"></div>
<script>
var player = flowplayer('#jiotv_go_player',
{
src: '{{ .play_url }}',
live: true,
seekable: false,
autplay: true,
qsel: {},
ui: flowplayer.ui.USE_THIN_CONTROLBAR,
preload: 'auto'
});
</script>
</body>

</html>
4 changes: 2 additions & 2 deletions cmd/jiotv_go/templates/play.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<body>
{{ template "navbar" . }}
<div class="p-1 sm:p-2 md:p-4 md:mx-8 lg:p-8 lg:mx-52">
<div id="player" class="relative overflow-hidden w-full pt-[56.25%]">
<div id="player" class="relative overflow-hidden w-full pt-[56.25%] rounded-xl">
<iframe class="absolute top-0 left-0 bottom-0 right-0 w-full h-full" src="{{ .player_url }}" width="100%"
height="100%" allowfullscreen="true"></iframe>
height="100%" webkitAllowFullScreen mozallowfullscreen allowfullscreen allow="autoplay"></iframe>
</div>
</div>
<script src="/static/common.js"></script>
Expand Down
10 changes: 9 additions & 1 deletion internals/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,15 @@ func PlayHandler(c *gin.Context) {
func PlayerHandler(c *gin.Context) {
id := c.Param("id")
play_url := "/live/" + id + ".m3u8"
c.HTML(http.StatusOK, "player.html", gin.H{
c.HTML(http.StatusOK, "flow_player.html", gin.H{
"play_url": play_url,
})
}

func ClapprHandler(c *gin.Context) {
id := c.Param("id")
play_url := "/live/" + id + ".m3u8"
c.HTML(http.StatusOK, "clappr.html", gin.H{
"play_url": play_url,
})
}

0 comments on commit da4fe8d

Please sign in to comment.