Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can I access playlist items fields #2

Open
alixTal opened this issue Nov 29, 2021 · 0 comments
Open

how can I access playlist items fields #2

alixTal opened this issue Nov 29, 2021 · 0 comments

Comments

@alixTal
Copy link

alixTal commented Nov 29, 2021

Hi, I am new to Golang, I'm using your example for reading a playlist,

playlist, err := m3u8.Read(resp.Body)

fmt.Println(reflect.TypeOf(playlist.Items[0]))
fmt.Println(playlist.Items[0])

output

*m3u8.SegmentItem
#EXTINF:10,
https://multiplatform-f.akamaihd.net/i/multi/will/bunny/big_buck_bunny_,640x360_400,640x360_700,640x360_1000,950x540_1500,.f4v.csmil/segment1_0_av.ts

I looked at Segmentitem type and it has these fields:

type SegmentItem struct {
	Duration        float64
	Segment         string
	Comment         *string
	ProgramDateTime *TimeItem
	ByteRange       *ByteRange
}

when I want to get access to playlist.Items[0].Segment I get this error.

playlist.Items[0].Segment undefined (type m3u8.Item has no field or method Segment)

I want to know how can I access the playlist item fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant