m3u8
m3u8 copied to clipboard
Feature Request: m3u8.MediaSegment implements fmt.Stringer
hello dev. Thanks you for your great work. the library is very useful :-)
I'd like to implement (m MediaSegment) String()string for testing like below.
When failing test, I'd like to report as m3u8 text.
package something
import (
"github.com/grafov/m3u8"
"testing"
)
func TestXXX(t *testing.T) {
var expected, actual m3u8.MediaSegment
actual = do_something()
if expected.SeqId != actual.SeqId {
t.Fatalf("expected:%s, but actual:%s\n", expected.String(), actual.String())
}
}
there are already (p *MediaPlaylist) String() string and it converts m3u8.MeidaSegment to string.
We can use the procedure to implement function I request.
If you agree to the issue but don't have enough time, I'd like to send PR.
This sounds reasonable, but there's a lot to output, what do you think it would show?
If you agree to the issue but don't have enough time, I'd like to send PR.
This would be great, thanks.
It would be good it is same result to media segment part of (p *m3u8.MediaPlaylist) String() string
When all m3u8.MediaSegment field is presense,
(p *m3u8.MediaPlaylist) Decode()(byte.Buffer, error) and (p *m3u8.MediaPlaylist) String() string dump like this .
#EXT-SCTE35:CUE="base64==",ID="identify",TIME=30
#EXT-X-KEY:METHOD=,URI="http://example.com/key",IV=iv
#EXT-X-DISCONTINUITY
#EXT-X-MAP:URI="http;//url",BYTERANGE=10@0
#EXT-X-BYTERANGE:10@0
#EXTINF:10.000,hogehoge
http://example.com/media.ts
I suppose it is not so a lot.
That looks good to me.
@grafov thoughts?
@bradleyfalzon I think it is ok to implement such method. @keizo042 would you create PR?