Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for more tags from rfc (#3)
* feat: Implement support for more RFC 8216 tags Expanded support for RFC 8216 compliant tags in the playlist builder. Additional tags such as 'ExtXKey', 'ExtXMap', 'ExtXProgramDateTime', and others were added. Error handling for invalid formats for numerous fields were integrated, ensuring robustness. We verified compliance by validating every tag according to their respective rules. * chore: Improve several aspects of the m3u8 module Enhancements have been made to the m3u8 module. The target_duration function now accepts a u64 value instead of a u32, expanding possible duration values. We've also added `#[allow(clippy::too_many_arguments)]` to bypass Clippy's warnings for the media and stream_inf function. Also, more meaningful error messages have been added and the code is now streamlined for improved tag extraction. For validation.rs, we replaced the u32 data type with the u64 in InvalidTargetDuration to match the change in builder.rs. * chore: Refactor tests and update M3U8 playlist parsing code This commit refactors test cases and updates revisions in the M3U8 playlist parsing code. Changes include an update in version numbers from 3 to 7, and adjustments in parsing and building logic. Commented out explanations for the playlist builder were also removed. The changes were necessary to keep the tests consistent with the updates in the parsing logic. * feat: Add ExtXPlaylistType support in M3U8 tags and builder This commit introduces the `ExtXPlaylistType` tag to the M3U8 playlist parser, which provides mutability information about the playlist. It also updates the builder to support adding this tag, and includes a new Makefile for testing and linting with cargo. * chore: Refactor to use string references in builder methods This commit changes builder methods to use string references (`&str`) instead of `String` for several fields. This improves performance by avoiding unnecessary allocations and simplifies the function signatures. Corresponding test adjustments have also been made to reflect these changes. * chore: Add `Clone` to `Tag` and refactor `PlaylistBuilder` Implemented the `Clone` trait for `Tag` and refactored `PlaylistBuilder` to use `Rc<RefCell<Vec<Tag>>>` for better state management. Additionally, added `cargo fmt` to the `check` target in the `Makefile` to enforce consistent code formatting. * chore: Remove InvalidMediaSequence error handling. Invalid media sequence number error handling has been deemed unnecessary and thus removed from validation.rs and playlist/mod.rs. Other existing validation errors remain unaffected. * Refactor ExtInf to include URI Revised the structure of the `ExtInf` tag to encapsulate the URI directly within it, removing the need for separate `Uri` tags. This change simplifies the tag structure and ensures better cohesion by combining related data into a single tag. * Add regex dependency and remove EXT-X-DATE_RANGE tags Added regex as a new dependency in Cargo.toml. Removed EXT-X-DATE-RANGE support and related tests from the codebase. Updated Playlist parsing to process lines more efficiently using regex.
- Loading branch information