Class: Teems::Commands::DashManifestParser

Inherits:
Object
  • Object
show all
Defined in:
lib/teems/commands/meeting_recording.rb

Overview

Parses DASH MPD manifest XML to extract video/audio segment info

Defined Under Namespace

Classes: Segment, Track

Constant Summary collapse

ADAPTATION_RE =
%r{<AdaptationSet[^>]*contentType="(video|audio)"(.*?)</AdaptationSet>}m
TEMPLATE_RE =
/<SegmentTemplate[^>]*/
TIMELINE_RE =
%r{<SegmentTimeline>(.*?)</SegmentTimeline>}m
SEGMENT_RE =
/<S\s[^>]*>/
REP_RE =
/<Representation[^>]*id="([^"]+)"/

Instance Method Summary collapse

Constructor Details

#initialize(mpd_xml) ⇒ DashManifestParser

Returns a new instance of DashManifestParser.



19
20
21
22
23
# File 'lib/teems/commands/meeting_recording.rb', line 19

def initialize(mpd_xml)
  @xml = mpd_xml
  @attrs = nil
  @rep_id = nil
end

Instance Method Details

#parseObject



25
26
27
28
29
30
31
32
# File 'lib/teems/commands/meeting_recording.rb', line 25

def parse
  tracks = []
  @xml.scan(ADAPTATION_RE) do |type, body|
    track = parse_adaptation(type, body)
    tracks << track if track
  end
  tracks
end