func magicContainer(filePath string) (Container, error) {
	file, err := os.Open(filePath)
	if err != nil {
		return "", err
	}

	defer file.Close()

	buf := make([]byte, 4096)
	_, err = file.Read(buf)
	if err != nil {
		return "", err
	}

	if webm(buf) {
		return Webm, nil
	}
	if mkv(buf) {
		return Matroska, nil
	}
	return "", nil
}
// magicContainer returns the container type of a file path.
// Returns the zero-value on errors or no-match. Implements mkv or
// webm only, as ffprobe can't distinguish between them and not all
// browsers support mkv
magicContainer returns the container type of a file path.
Returns the zero-value on errors or no-match. Implements mkv or
webm only, as ffprobe can't distinguish between them and not all
browsers support mkv
// magicContainer returns the container type of a file path . // Returns the zero - value on errors or no - match . Implements mkv or // webm only as ffprobe can ' t distinguish between them and not all // browsers support mkv
func magicContainer(filePath string) (Container, error) {
	file, err := os.Open(filePath)
	if err != nil {
		return "", err
	}
	defer file.Close()
	buf := make([]byte, 4096)
	_, err = file.Read(buf)
	if err != nil {
		return "", err
	}
	if webm(buf) {
		return Webm, nil
	}
	if mkv(buf) {
		return Matroska, nil
	}
	return "", nil
}
func magicContainer ( filePath string ) ( Container , error ) { file , err := os . Open ( filePath ) if err != nil { return " " , err } defer file . Close ( ) buf := make ( [ ] byte , 4096 ) _ , err = file . Read ( buf ) if err != nil { return " " , err } if webm ( buf ) { return Webm , nil } if mkv ( buf ) { return Matroska , nil } return " " , nil }
magicContainer returns the container type of a file path.
magicContainer returns the container type of a file path .