Major improvements to UnifiedPlayer: 1. GetFrameImage() now works when paused for responsive UI updates 2. Play() method properly starts FFmpeg process 3. Frame display loop runs continuously for smooth video display 4. Disabled audio temporarily to fix video playback fundamentals 5. Simplified FFmpeg command to focus on video stream only Player now: - Generates video frames correctly - Shows video when paused - Has responsive progress tracking - Starts playback properly Next steps: Re-enable audio playback once video is stable
44 lines
935 B
Go
44 lines
935 B
Go
//go:build darwin && !ios
|
|
|
|
package locale
|
|
|
|
// Non-CGO implementation is in locale_darwin_nocgo.go
|
|
|
|
/*
|
|
#cgo CFLAGS: -x objective-c
|
|
#cgo LDFLAGS: -framework Foundation
|
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
const char * preferredLocalization();
|
|
const char * preferredLocalizations();
|
|
*/
|
|
import "C"
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// GetLocale retrieves the IETF BCP 47 language tag set on the system.
|
|
func GetLocale() (string, error) {
|
|
str := C.preferredLocalization()
|
|
if output := C.GoString(str); output != "" {
|
|
return strings.Replace(output, "_", "-", 1), nil
|
|
}
|
|
|
|
return getLocaleCli()
|
|
}
|
|
|
|
// GetLocales retrieves the IETF BCP 47 language tags set on the system.
|
|
func GetLocales() ([]string, error) {
|
|
str := C.preferredLocalizations()
|
|
if output := C.GoString(str); output != "" {
|
|
r := []string{}
|
|
for _, s := range strings.Split(output, ",") {
|
|
r = append(r, strings.Replace(s, "_", "-", 1))
|
|
}
|
|
return r, nil
|
|
}
|
|
|
|
return getLocalesCli()
|
|
}
|