Improve casting resume behavior
All checks were successful
Build on Push and create Release on Tag / build (push) Successful in 15m49s
All checks were successful
Build on Push and create Release on Tag / build (push) Successful in 15m49s
This commit is contained in:
parent
150348c391
commit
4cf9a2a58f
3 changed files with 57 additions and 11 deletions
|
@ -39,16 +39,10 @@ func (c *Controller) StartCasting(selected string, mediaURL string) {
|
|||
return
|
||||
}
|
||||
|
||||
err := c.Model.ConnectToDevice(selected)
|
||||
if err != nil {
|
||||
c.LogAndShowError(fmt.Errorf("error connecting to device %v", err))
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
err = c.Model.StartCast(mediaURL)
|
||||
err := c.Model.Cast(selected, mediaURL)
|
||||
if err != nil {
|
||||
c.LogAndShowError(fmt.Errorf("error starting cast %v", err))
|
||||
c.DiscoverDevices()
|
||||
c.LogAndShowError(fmt.Errorf("error starting cast: %v", err))
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
@ -56,6 +50,10 @@ func (c *Controller) StartCasting(selected string, mediaURL string) {
|
|||
|
||||
}
|
||||
|
||||
func (c *Controller) ShowReconnecting(reconnecting bool) {
|
||||
c.View.PopupReconnecting(reconnecting)
|
||||
}
|
||||
|
||||
// Note: these are app codes, they are NOT related to fcast opcodes!
|
||||
const (
|
||||
ActionPlay = 0
|
||||
|
@ -78,7 +76,6 @@ func (c *Controller) PlayerAction(action int, args ...float32) {
|
|||
}
|
||||
|
||||
func (c *Controller) ExitCasting() {
|
||||
c.PlayerAction(ActionStop)
|
||||
c.DiscoverDevices()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue