diff --git a/mpd/mpd.go b/mpd/mpd.go index ed4f8ab..ffac1cd 100644 --- a/mpd/mpd.go +++ b/mpd/mpd.go @@ -779,7 +779,7 @@ func NewWidevineContentProtection(wvHeader []byte) (*WidevineContentProtection, if err != nil { panic(err.Error()) } - psshBox, err := makePSSHBox(wvSystemID, wvHeader) + psshBox, err := MakePSSHBox(wvSystemID, wvHeader) if err != nil { return nil, err } @@ -853,7 +853,7 @@ func (as *AdaptationSet) AddNewContentProtectionSchemePlayreadyWithPSSH(pro stri return nil, err } - psshBox, err := makePSSHBox(prSystemID, proBin) + psshBox, err := MakePSSHBox(prSystemID, proBin) if err != nil { return nil, err } @@ -885,7 +885,7 @@ func (as *AdaptationSet) AddNewContentProtectionSchemePlayreadyV10WithPSSH(pro s return nil, err } - psshBox, err := makePSSHBox(prSystemID, proBin) + psshBox, err := MakePSSHBox(prSystemID, proBin) if err != nil { return nil, err } diff --git a/mpd/pssh.go b/mpd/pssh.go index d558163..98a7112 100644 --- a/mpd/pssh.go +++ b/mpd/pssh.go @@ -6,7 +6,7 @@ import ( "fmt" ) -func makePSSHBox(systemID, payload []byte) ([]byte, error) { +func MakePSSHBox(systemID, payload []byte) ([]byte, error) { if len(systemID) != 16 { return nil, fmt.Errorf("SystemID must be 16 bytes, was: %d", len(systemID)) } diff --git a/mpd/pssh_test.go b/mpd/pssh_test.go index 2ddf354..a681194 100644 --- a/mpd/pssh_test.go +++ b/mpd/pssh_test.go @@ -23,7 +23,7 @@ func TestMakePSSHBox_Widevine(t *testing.T) { panic(err.Error()) } - psshBox, err := makePSSHBox(wvSystemID, payload) + psshBox, err := MakePSSHBox(wvSystemID, payload) require.NoError(t, err) require.EqualString(t, string(expectedPSSH), string(psshBox)) @@ -46,18 +46,18 @@ func TestMakePSSHBox_Playready(t *testing.T) { panic(err.Error()) } - psshBox, err := makePSSHBox(wvSystemID, payload) + psshBox, err := MakePSSHBox(wvSystemID, payload) require.NoError(t, err) require.EqualString(t, string(expectedPSSH), string(psshBox)) } func TestMakePSSHBox_BadSystemID(t *testing.T) { - _, err := makePSSHBox([]byte("meaningless byte array"), nil) + _, err := MakePSSHBox([]byte("meaningless byte array"), nil) require.EqualError(t, err, "SystemID must be 16 bytes, was: 22") } func TestMakePSSHBox_NilSystemID(t *testing.T) { - _, err := makePSSHBox(nil, nil) + _, err := MakePSSHBox(nil, nil) require.EqualError(t, err, "SystemID must be 16 bytes, was: 0") }