X Tutup
The Wayback Machine - https://web.archive.org/web/20201016202816/https://github.com/alfg/widevine
Skip to content
master
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Widevine

Golang Client API for Widevine Cloud.

https://godoc.org/github.com/alfg/widevine

Build Status Build status GoDoc

Install

go get github.com/alfg/widevine

Usage

Generating license keys

// Set Widevine options and create instance.
options := widevine.Options{
    Key:      []byte{key},     // Your Widevine Key as a byte array.
    IV:       []byte{iv},      // Your Widevine IV as a byte array.
    Provider: "widevine_test", // Your Widevine Provider/Portal.
}

// Create the Widevine instance.
wv := widevine.New(options)

// Your video content ID, usually a GUID.
contentID := "testing"

// Set policy options.
policy := widevine.Policy{
    ContentID: contentID,
    Tracks:    []string{"SD", "HD", "AUDIO"},
    DRMTypes:  []string{"WIDEVINE"},
    Policy:    "default",
}

// Make the request to generate or get a content key.
resp := wv.GetContentKey(contentID, policy)

// Response data from Widevine Cloud.
fmt.Println("status: ", resp.Status)
fmt.Println("drm: ", resp.DRM)
for _, v := range resp.Tracks {
    fmt.Println("key_id: ", v.KeyID)
    fmt.Println("type: ", v.Type)
    fmt.Println("drm_type: ", v.PSSH[0].DRMType)
    fmt.Println("data: ", v.PSSH[0].Data)
}
fmt.Println("already_used: ", resp.AlreadyUsed)

License Proxy

You can also use this package to create a license proxy.

See: examples/proxy

Examples

See: examples

Develop

TODO

protoc.exe --go_out=. *.proto

TODO

  • External Keys
  • Custom PSSH API
  • Tests
  • More error handling
  • Implement more Widevine features

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.
X Tutup