Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
45bbed7
Update screenshots
alexballas Dec 14, 2024
101e153
Update screenshots again
alexballas Dec 15, 2024
0ed117e
Allow to seek when transcoding
alexballas Dec 20, 2024
b85b272
Update a poorly written comment
alexballas Dec 20, 2024
8d37dc7
Fix Windows build
alexballas Dec 20, 2024
d4f4053
Add seek support on dragEnd for transcoded streams
alexballas Dec 20, 2024
9500696
Pass charenc in ffmpeg only if it's not UTF-8
alexballas Dec 20, 2024
a4cd63f
Use standard port for ssdp discovery. Also try to fix CLI issue on wi…
alexballas Dec 22, 2024
1c563c6
Fix mobile build
alexballas Dec 22, 2024
1eca8b0
FFmpeg UI improvement. Fix language change for Windows and Mac
alexballas Dec 24, 2024
5b02dcc
Update translations
alexballas Dec 24, 2024
96c4cfd
Further UI improvements
alexballas Dec 25, 2024
bc36f1e
Update readme
alexballas Dec 26, 2024
f9da0a9
Clean up stuff
alexballas Dec 27, 2024
f5bed36
Add FyneApp.toml. Update documentation
alexballas Dec 27, 2024
cec5657
Fix Windows build
alexballas Dec 27, 2024
1611920
misspell
alexballas Dec 28, 2024
9317d63
Better system theme detection.
alexballas Dec 29, 2024
f7b4cbe
Dead code
alexballas Dec 29, 2024
7cdbe35
don't assume ffmpeg paths
lostdusty Dec 29, 2024
e426f3f
Update theme code AGAIN
alexballas Dec 29, 2024
ee92729
Update settings window. Add a button to reset the ffmpeg path
alexballas Dec 29, 2024
c72f40b
Merge branch 'devel' into patch-1
alexballas Dec 30, 2024
01c8321
Merge pull request #97 from lostdusty/patch-1
alexballas Dec 30, 2024
ed63983
Update translatios
alexballas Dec 30, 2024
6e4be51
Fix broken builds
alexballas Dec 30, 2024
9421b75
Fix crash when using gapless playback
alexballas Dec 31, 2024
5dab476
Update translations
alexballas Jan 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
LDFLAGS="-s -w"
WINLDFLAGS="-H=windowsgui -s -w"

build: clean
go build -trimpath -ldflags $(LDFLAGS) -o build/go2tv cmd/go2tv/go2tv.go

windows: clean
env CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 go build -trimpath -ldflags $(WINLDFLAGS) -o build/go2tv.exe cmd/go2tv/go2tv.go
env CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 go build -trimpath -ldflags $(LDFLAGS) -o build/go2tv.exe cmd/go2tv/go2tv.go

install: build
mkdir -vp /usr/local/bin/
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ This is a GUI only limitation.

Build requirements and dependencies
-----
- Go v1.19+
- Go v1.23+
- ffmpeg (optional)

**Build using Docker**
Expand All @@ -73,13 +73,21 @@ $ docker build --force-rm [--pull] -t go2tv github.com/alexballas/go2tv#main
```
Notice the branch name after the `#`, as the above will build `main`. You can also build `devel` if you want to build the latest code. Usage under Docker is outside this document's scope, check Docker docs for more information, specially volume mounts and networking. [x11docker](https://github.com/mviereck/x11docker) might come handy to run GUI mode, although it's not tested, since main Docker usage is CLI.

**Running using Docker**

Example:
``` console
$ xhost +local:docker # Allows Docker containers to connect to the X server
$ docker run -it --network host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix go2tv go2tv
```

Quick Start
-----
Download the app here https://github.com/alexballas/Go2TV/releases/latest. A single executable. No installation or external dependencies.

**Transcoding (ffmpeg required)**

Go2TV supports live video transcoding, if ffmpeg is installed. When transcoding, SEEK operations are not available. Transcoding offers the maximum compatibility with the various file formats and devices. Only works with video files.
Go2TV supports live video transcoding, if ffmpeg is installed. When transcoding, SEEK operations are not available. Transcoding offers the maximum compatibility with the various file formats and devices. Only works with video files. *Note:* The Flatpak version of Go2TV bundles ffmpeg.

**MKV/MP4 Subtitle Selection Support (ffmpeg required)**

Expand Down
Binary file modified assets/screenshots/Screenshot_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshots/Screenshot_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions cmd/go2tv-lite/go2tv.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ var (
listPtr = flag.Bool("l", false, "List all available UPnP/DLNA Media Renderer models and URLs.")
versionPtr = flag.Bool("version", false, "Print version.")

ErrNoCombi = errors.New("can't combine -l with other flags")
ErrFailtoList = errors.New("failed to list devices")
errNoCombi = errors.New("can't combine -l with other flags")
errFailtoList = errors.New("failed to list devices")
)

type dummyScreen struct {
Expand Down Expand Up @@ -195,12 +195,12 @@ func listFlagFunction() error {
})

if flagsEnabled > 1 {
return ErrNoCombi
return errNoCombi
}

deviceList, err := devices.LoadSSDPservices(1)
if err != nil {
return ErrFailtoList
return errFailtoList
}

fmt.Println()
Expand Down
2 changes: 1 addition & 1 deletion cmd/go2tv-lite/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.17.1
1.18.0
8 changes: 8 additions & 0 deletions cmd/go2tv/FyneApp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Website = "https://go2tv.app"

[Details]
Icon = "assets/go2tv-icon-desktop-512.png"
Name = "go2tv"
ID = "com.go2tv.go2tv"
Version = "1.18.0"
Build = 1
10 changes: 5 additions & 5 deletions cmd/go2tv/go2tv.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ var (
listPtr = flag.Bool("l", false, "List all available UPnP/DLNA Media Renderer models and URLs.")
versionPtr = flag.Bool("version", false, "Print version.")

ErrNoCombi = errors.New("can't combine -l with other flags")
ErrFailtoList = errors.New("failed to list devices")
errNoCombi = errors.New("can't combine -l with other flags")
errFailtoList = errors.New("failed to list devices")
)

type flagResults struct {
Expand Down Expand Up @@ -106,7 +106,7 @@ func run() error {
}

if flagRes.gui {
scr := gui.InitFyneNewScreen(version)
scr := gui.NewFyneScreen(version)
gui.Start(exitCTX, scr)
return nil
}
Expand Down Expand Up @@ -191,12 +191,12 @@ func listFlagFunction() error {
})

if flagsEnabled > 1 {
return ErrNoCombi
return errNoCombi
}

deviceList, err := devices.LoadSSDPservices(1)
if err != nil {
return ErrFailtoList
return errFailtoList
}

fmt.Println()
Expand Down
2 changes: 1 addition & 1 deletion cmd/go2tv/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.17.1
1.18.0
2 changes: 1 addition & 1 deletion devices/devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (
func LoadSSDPservices(delay int) (map[string]string, error) {
// Reset device list every time we call this.
urlList := make(map[string]string)
list, err := ssdp.Search(ssdp.All, delay, "")
list, err := ssdp.Search(ssdp.All, delay, "239.255.255.250:1900")
if err != nil {
return nil, fmt.Errorf("LoadSSDPservices search error: %w", err)
}
Expand Down
17 changes: 8 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/alexballas/go2tv

go 1.23.1
go 1.23.3

require (
fyne.io/fyne/v2 v2.5.2
fyne.io/fyne/v2 v2.5.3
github.com/alexballas/go-ssdp v0.0.3
github.com/gdamore/tcell/v2 v2.7.4
github.com/h2non/filetype v1.1.3
Expand All @@ -12,7 +12,9 @@ require (
github.com/mitchellh/mapstructure v1.5.0
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.33.0
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
golang.org/x/sys v0.28.0
golang.org/x/time v0.8.0
)

Expand All @@ -29,11 +31,11 @@ require (
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71 // indirect
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a // indirect
github.com/go-text/render v0.2.0 // indirect
github.com/go-text/typesetting v0.2.0 // indirect
github.com/go-text/typesetting v0.2.1 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/jeandeaual/go-locale v0.0.0-20241204123234-32dda1c00a20 // indirect
github.com/jeandeaual/go-locale v0.0.0-20241217141322-fcc2cadd6f08 // indirect
github.com/jsummers/gobmp v0.0.0-20230614200233-a9de23ed2e25 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand All @@ -47,12 +49,9 @@ require (
github.com/stretchr/testify v1.10.0 // indirect
github.com/yuin/goldmark v1.7.8 // indirect
golang.org/x/image v0.23.0 // indirect
golang.org/x/mobile v0.0.0-20241204233305-ce44b2716d33 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/mobile v0.0.0-20241213221354-a87c1cf6cf46 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

//replace fyne.io/fyne/v2 => github.com/alexballas/fyne/v2 v2.3.2-patches2
26 changes: 14 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
fyne.io/fyne/v2 v2.5.2 h1:eSyGTmSkv10yAdAeHpDet6u2KkKxOGFc14kQu81We7Q=
fyne.io/fyne/v2 v2.5.2/go.mod h1:26gqPDvtaxHeyct+C0BBjuGd2zwAJlPkUGSBrb+d7Ug=
fyne.io/fyne/v2 v2.5.3 h1:k6LjZx6EzRZhClsuzy6vucLZBstdH2USDGHSGWq8ly8=
fyne.io/fyne/v2 v2.5.3/go.mod h1:0GOXKqyvNwk3DLmsFu9v0oYM0ZcD1ysGnlHCerKoAmo=
fyne.io/systray v1.11.0 h1:D9HISlxSkx+jHSniMBR6fCFOUjk1x/OOOJLa9lJYAKg=
fyne.io/systray v1.11.0/go.mod h1:RVwqP9nYMo7h5zViCBHri2FgjXF7H2cub7MAq4NSoLs=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
Expand Down Expand Up @@ -107,10 +107,10 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a h1:vxnBhFDDT+
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-text/render v0.2.0 h1:LBYoTmp5jYiJ4NPqDc2pz17MLmA3wHw1dZSVGcOdeAc=
github.com/go-text/render v0.2.0/go.mod h1:CkiqfukRGKJA5vZZISkjSYrcdtgKQWRa2HIzvwNN5SU=
github.com/go-text/typesetting v0.2.0 h1:fbzsgbmk04KiWtE+c3ZD4W2nmCRzBqrqQOvYlwAOdho=
github.com/go-text/typesetting v0.2.0/go.mod h1:2+owI/sxa73XA581LAzVuEBZ3WEEV2pXeDswCH/3i1I=
github.com/go-text/typesetting-utils v0.0.0-20240317173224-1986cbe96c66 h1:GUrm65PQPlhFSKjLPGOZNPNxLCybjzjYBzjfoBGaDUY=
github.com/go-text/typesetting-utils v0.0.0-20240317173224-1986cbe96c66/go.mod h1:DDxDdQEnB70R8owOx3LVpEFvpMK9eeH1o2r0yZhFI9o=
github.com/go-text/typesetting v0.2.1 h1:x0jMOGyO3d1qFAPI0j4GSsh7M0Q3Ypjzr4+CEVg82V8=
github.com/go-text/typesetting v0.2.1/go.mod h1:mTOxEwasOFpAMBjEQDhdWRckoLLeI/+qrQeBCTGEt6M=
github.com/go-text/typesetting-utils v0.0.0-20241103174707-87a29e9e6066 h1:qCuYC+94v2xrb1PoS4NIDe7DGYtLnU2wWiQe9a1B1c0=
github.com/go-text/typesetting-utils v0.0.0-20241103174707-87a29e9e6066/go.mod h1:DDxDdQEnB70R8owOx3LVpEFvpMK9eeH1o2r0yZhFI9o=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
Expand Down Expand Up @@ -216,8 +216,8 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jeandeaual/go-locale v0.0.0-20241204123234-32dda1c00a20 h1:S6sn9jRW3oq1k/Qiwa20F+E57ZVJ2+KB1Vp5xiJ1FlI=
github.com/jeandeaual/go-locale v0.0.0-20241204123234-32dda1c00a20/go.mod h1:pYcXQtDPRThfL37oZEzUVo2Jb8ua0NEC7rZqrxXyuhA=
github.com/jeandeaual/go-locale v0.0.0-20241217141322-fcc2cadd6f08 h1:wMeVzrPO3mfHIWLZtDcSaGAe2I4PW9B/P5nMkRSwCAc=
github.com/jeandeaual/go-locale v0.0.0-20241217141322-fcc2cadd6f08/go.mod h1:ZDXo8KHryOWSIqnsb/CiDq7hQUYryCgdVnxbj8tDG7o=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
Expand Down Expand Up @@ -290,6 +290,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/rymdport/portal v0.3.0 h1:QRHcwKwx3kY5JTQcsVhmhC3TGqGQb9LFghVNUy8AdB8=
github.com/rymdport/portal v0.3.0/go.mod h1:kFF4jslnJ8pD5uCi17brj/ODlfIidOxlgUDTO5ncnC4=
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7AwssoOcM/tq5JjjG2yYOc8odClEiXA=
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
Expand Down Expand Up @@ -380,8 +382,8 @@ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPI
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mobile v0.0.0-20211207041440-4e6c2922fdee/go.mod h1:pe2sM7Uk+2Su1y7u/6Z8KJ24D7lepUjFZbhFOrmDfuQ=
golang.org/x/mobile v0.0.0-20241204233305-ce44b2716d33 h1:MeYjBsMjR6w9aXA3oHEJWCQ5bnD5fOjesYMOn52ovQY=
golang.org/x/mobile v0.0.0-20241204233305-ce44b2716d33/go.mod h1:Sf9LBimL0mWKEdgAjRmJ6iu7Z34osHQTK/devqFbM2I=
golang.org/x/mobile v0.0.0-20241213221354-a87c1cf6cf46 h1:E+R1qmJL8cmWTyWXBHVtmqRxr7FdiTwntffsba1F1Tg=
golang.org/x/mobile v0.0.0-20241213221354-a87c1cf6cf46/go.mod h1:Sf9LBimL0mWKEdgAjRmJ6iu7Z34osHQTK/devqFbM2I=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
Expand Down Expand Up @@ -432,8 +434,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down
13 changes: 9 additions & 4 deletions httphandlers/httphandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type osFileType struct {
path string
}

// AddHandler dynamically adds a new handler. Currenly used by the gapless playback logic where we use
// AddHandler dynamically adds a new handler. Currently used by the gapless playback logic where we use
// the same server to serve multiple media files.
func (s *HTTPserver) AddHandler(path string, payload *soapcalls.TVPayload, media interface{}) {
s.mu.Lock()
Expand Down Expand Up @@ -87,7 +87,10 @@ func (s *HTTPserver) StartServer(serverStarted chan<- error, media, subtitles in
// Dynamically add handlers to better support gapless playback where we're
// required to serve new files with our existing HTTP server.
s.AddHandler(mURL.Path, tvpayload, media)
s.AddHandler(sURL.Path, nil, subtitles)

if sURL.Path != "/." && !tvpayload.Transcode {
s.AddHandler(sURL.Path, nil, subtitles)
}

callbackURL, err := url.Parse(tvpayload.CallbackURL)
if err != nil {
Expand Down Expand Up @@ -165,6 +168,7 @@ func (s *HTTPserver) callbackHandler(tv *soapcalls.TVPayload, screen Screen) htt

reqParsedUnescape := html.UnescapeString(string(reqParsed))
previousstate, newstate, err := soapcalls.EventNotifyParser(reqParsedUnescape)

if err != nil {
http.NotFound(w, req)
return
Expand Down Expand Up @@ -293,7 +297,7 @@ func serveContentReadClose(w http.ResponseWriter, r *http.Request, tv *soapcalls
// Since we're dealing with an io.Reader we can't
// allow any HEAD requests that some DMRs trigger.
if transcode && r.Method == http.MethodGet && strings.Contains(mediaType, "video") {
_ = utils.ServeTranscodedStream(w, f, ff, tv.FFmpegPath)
_ = utils.ServeTranscodedStream(w, f, ff, tv.FFmpegPath, tv.FFmpegSubsPath, tv.FFmpegSeek)
return
}

Expand Down Expand Up @@ -330,7 +334,8 @@ func serveContentCustomType(w http.ResponseWriter, r *http.Request, tv *soapcall
if f.path != "" {
input = f.path
}
_ = utils.ServeTranscodedStream(w, input, ff, tv.FFmpegPath)

_ = utils.ServeTranscodedStream(w, input, ff, tv.FFmpegPath, tv.FFmpegSubsPath, tv.FFmpegSeek)
return
}

Expand Down
4 changes: 2 additions & 2 deletions internal/gui/about.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fyne.io/fyne/v2/widget"
)

func aboutWindow(s *NewScreen) fyne.CanvasObject {
func aboutWindow(s *FyneScreen) fyne.CanvasObject {
sr := fyne.NewStaticResource("Go2TV Icon", go2TVSmallIcon)
go2tvImage := canvas.NewImageFromResource(sr)
richhead := widget.NewRichTextFromMarkdown(`
Expand Down Expand Up @@ -70,7 +70,7 @@ MIT
return container.NewPadded(cont)
}

func checkVersion(s *NewScreen) {
func checkVersion(s *FyneScreen) {
s.CheckVersion.Disable()
defer s.CheckVersion.Enable()
errRedirectChecker := errors.New("redirect")
Expand Down
4 changes: 2 additions & 2 deletions internal/gui/about_mobile.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fyne.io/fyne/v2/widget"
)

func aboutWindow(s *NewScreen) fyne.CanvasObject {
func aboutWindow(s *FyneScreen) fyne.CanvasObject {
richhead := widget.NewRichTextFromMarkdown(`
# Go2TV

Expand Down Expand Up @@ -62,7 +62,7 @@ MIT
return container.NewVBox(richhead, container.NewCenter(container.NewHBox(githubbutton, checkversion)))
}

func checkVersion(s *NewScreen) {
func checkVersion(s *FyneScreen) {
s.CheckVersion.Disable()
defer s.CheckVersion.Enable()
errRedirectChecker := errors.New("redirect")
Expand Down
Loading
Loading