mirror of
				https://github.com/owncast/owncast.git
				synced 2025-11-01 02:44:31 +08:00 
			
		
		
		
	Add support for loading the owncast URL in mpv (#1356)
* redirect players to hls link * add VLC to players list
This commit is contained in:
		| @ -86,6 +86,27 @@ func IsUserAgentABot(userAgent string) bool { | ||||
| 	return ua.Bot() | ||||
| } | ||||
|  | ||||
| // IsUserAgentAPlayer returns if a web client user-agent is seen as a media player. | ||||
| func IsUserAgentAPlayer(userAgent string) bool { | ||||
| 	if userAgent == "" { | ||||
| 		return false | ||||
| 	} | ||||
|  | ||||
| 	playerStrings := []string{ | ||||
| 		"mpv", | ||||
| 		"player", | ||||
| 		"vlc", | ||||
| 	} | ||||
|  | ||||
| 	for _, playerString := range playerStrings { | ||||
| 		if strings.Contains(strings.ToLower(userAgent), playerString) { | ||||
| 			return true | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| func RenderSimpleMarkdown(raw string) string { | ||||
| 	markdown := goldmark.New( | ||||
| 		goldmark.WithRendererOptions( | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Meisam
					Meisam