mirror of
https://github.com/rutgersc/m3u8-rs.git
synced 2025-03-12 09:21:28 +00:00
Update readme with new attribute
This commit is contained in:
parent
dc352301a3
commit
677027e22c
2 changed files with 7 additions and 4 deletions
|
@ -67,12 +67,12 @@ match parsed {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Currently the parser will succeed even if REQUIRED attributes/tags are missing from a playlist (such as the `#EXT-X-VERSION` tag).
|
Currently, the parser will succeed even if REQUIRED attributes/tags are missing from a playlist (such as the `#EXT-X-VERSION` tag).
|
||||||
The option to abort parsing when attributes/tags are missing may be something to add later on.
|
The option to abort parsing when attributes/tags are missing may be something to add later on.
|
||||||
|
|
||||||
# Structure Summary
|
# Structure Summary
|
||||||
|
|
||||||
All of the details about the structs are taken from https://tools.ietf.org/html/draft-pantos-http-live-streaming-19.
|
All the details about the structs are taken from https://tools.ietf.org/html/draft-pantos-http-live-streaming-19.
|
||||||
|
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
@ -91,6 +91,8 @@ pub struct MasterPlaylist {
|
||||||
pub session_key: Option<SessionKey>,
|
pub session_key: Option<SessionKey>,
|
||||||
pub start: Option<Start>,
|
pub start: Option<Start>,
|
||||||
pub independent_segments: bool,
|
pub independent_segments: bool,
|
||||||
|
pub alternatives: Vec<AlternativeMedia>,
|
||||||
|
pub unknown_tags: Vec<ExtTag>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct MediaPlaylist {
|
pub struct MediaPlaylist {
|
||||||
|
@ -131,6 +133,7 @@ pub struct MediaSegment {
|
||||||
pub map: Option<Map>,
|
pub map: Option<Map>,
|
||||||
pub program_date_time: Option<String>,
|
pub program_date_time: Option<String>,
|
||||||
pub daterange: Option<String>,
|
pub daterange: Option<String>,
|
||||||
|
pub unknown_tags: Vec<ExtTag>,
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -715,7 +715,7 @@ mod test {
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut output = Vec::new();
|
let mut output = Vec::new();
|
||||||
write!(output, "{}", cue_out_tag);
|
write!(output, "{}", cue_out_tag).unwrap();
|
||||||
|
|
||||||
assert_eq!(std::str::from_utf8(output.as_slice()).unwrap(), "#EXT-X-CUE-OUT:DURATION=30")
|
assert_eq!(std::str::from_utf8(output.as_slice()).unwrap(), "#EXT-X-CUE-OUT:DURATION=30")
|
||||||
}
|
}
|
||||||
|
@ -728,7 +728,7 @@ mod test {
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut output = Vec::new();
|
let mut output = Vec::new();
|
||||||
write!(output, "{}", cue_in_tag);
|
write!(output, "{}", cue_in_tag).unwrap();
|
||||||
|
|
||||||
assert_eq!(std::str::from_utf8(output.as_slice()).unwrap(), "#EXT-X-CUE-IN")
|
assert_eq!(std::str::from_utf8(output.as_slice()).unwrap(), "#EXT-X-CUE-IN")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue