func (p *Player) onMessage(bus *gst.Bus, msg *gst.Message) { switch msg.GetType() { case gst.MESSAGE_EOS: p.pipe.SetState(gst.STATE_NULL) case gst.MESSAGE_ERROR: p.pipe.SetState(gst.STATE_NULL) err, debug := msg.ParseError() fmt.Printf("Error: %s (debug: %s)\n", err, debug) } }