Documentation ¶
Index ¶
- func ParseVTTCPayload(data []byte, cueStart int, cueEnd int) (string, error)
- func WebvttTimeString(time int) string
- type Body
- type CueSetting
- type Division
- type Head
- type Layout
- type Metadata
- type Paragraph
- type Region
- type Span
- type Style
- type Styling
- type TtmlDocument
- func (d *TtmlDocument) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (doc *TtmlDocument) Merge(other *TtmlDocument) *TtmlDocument
- func (doc *TtmlDocument) MergeFromData(data []byte) *TtmlDocument
- func (doc *TtmlDocument) SaveAsVTT(outPath string) error
- func (doc *TtmlDocument) ToVTT(w io.Writer) error
- func (doc *TtmlDocument) Write(w io.Writer) error
- type VTTCueBoxContent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseVTTCPayload ¶
func WebvttTimeString ¶
Types ¶
type CueSetting ¶
type CueSetting struct { Align string `webvtt:"align"` Line string `webvtt:"line"` Position string `webvtt:"position"` Size string `webvtt:"size"` SnapToLines string `webvtt:"snap-to-lines"` Vertical string `webvtt:"vertical"` WritingMode string `webvtt:"writing-mode"` BackgroundColor string `webvtt:"background-color"` Color string `webvtt:"color"` Font string `webvtt:"font"` FontFamily string `webvtt:"font-family"` FontSize string `webvtt:"font-size"` FontStyle string `webvtt:"font-style"` FontVariant string `webvtt:"font-variant"` FontWeight string `webvtt:"font-weight"` TextDecoration string `webvtt:"text-decoration"` TextShadow string `webvtt:"text-shadow"` WordSpacing string `webvtt:"word-spacing"` LineHeight string `webvtt:"line-height"` LetterSpacing string `webvtt:"letter-spacing"` Padding string `webvtt:"padding"` Animate string `webvtt:"animate"` AnimateColor string `webvtt:"animate-color"` AnimateDirection string `webvtt:"animate-direction"` AnimateFill string `webvtt:"animate-fill"` AnimateName string `webvtt:"animate-name"` AnimateRepeat string `webvtt:"animate-repeat"` AnimateState string `webvtt:"animate-state"` AnimateTiming string `webvtt:"animate-timing"` Lang string `webvtt:"lang"` Ruby string `webvtt:"ruby"` RubyAlign string `webvtt:"ruby-align"` RubyOverhang string `webvtt:"ruby-overhang"` RubyPosition string `webvtt:"ruby-position"` RubySpan string `webvtt:"ruby-span"` Voice string `webvtt:"voice"` VoiceDuration string `webvtt:"voice-duration"` VoiceRate string `webvtt:"voice-rate"` VoicePitch string `webvtt:"voice-pitch"` VoiceRange string `webvtt:"voice-range"` VoiceVolume string `webvtt:"voice-volume"` }
type Paragraph ¶
type Paragraph struct { Begin string `xml:"begin,attr"` End string `xml:"end,attr"` Region string `xml:"region,attr"` ID string `xml:"id,attr"` Role string `xml:"role,attr"` Text string `xml:",innerxml"` Span []Span `xml:"span"` Br string `xml:"br"` }
func (*Paragraph) MarshalXML ¶
type Region ¶
func (Region) MarshalXML ¶
type Span ¶
type Span struct { Text string `xml:",chardata"` Color string `xml:"color,attr"` TextAlign string `xml:"textAlign,attr"` }
func (Span) MarshalXML ¶
type TtmlDocument ¶
type TtmlDocument struct { XMLName xml.Name `xml:"tt"` Attrs []xml.Attr `xml:",attr"` Lang string `xml:"lang,attr,omitempty"` Head Head `xml:"head"` Body Body `xml:"body"` }
func NewTtml ¶
func NewTtml(data []byte) (*TtmlDocument, error)
func OpenTtml ¶
func OpenTtml(filename string) (*TtmlDocument, error)
func (*TtmlDocument) MarshalXML ¶
func (d *TtmlDocument) MarshalXML(e *xml.Encoder, start xml.StartElement) error
func (*TtmlDocument) Merge ¶
func (doc *TtmlDocument) Merge(other *TtmlDocument) *TtmlDocument
Merge does an in-memory merge of 2 TTML documents
func (*TtmlDocument) MergeFromData ¶
func (doc *TtmlDocument) MergeFromData(data []byte) *TtmlDocument
MergeFromData does an in-memory merge of 2 TTML documents, using the byte representation of a second doc Note that the timestamps aren't realigned, so the second doc should be a subset of the first.
func (*TtmlDocument) SaveAsVTT ¶
func (doc *TtmlDocument) SaveAsVTT(outPath string) error
SaveAsVTT saves the TTML document to the specified file in WebVTT format. This is a convenience method that calls ToVTT internally.
type VTTCueBoxContent ¶
func ExtractAtomWebVTT ¶
func ExtractAtomWebVTT(buf []byte) ([]VTTCueBoxContent, error)
ExtractAtomWebVTT extracts the WebVTT cues from an mp4 atom buffer timestamps are missing and should be capture using the trun box entries.
Click to show internal directories.
Click to hide internal directories.