diff --git a/.gitignore b/.gitignore index 0bb75ea..8e50635 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /bin/ /.shards/ *.dwarf +*.lock diff --git a/shard.yml b/shard.yml index 994bad6..e370994 100644 --- a/shard.yml +++ b/shard.yml @@ -7,6 +7,10 @@ authors: targets: playper: main: src/playper.cr + +dependencies: + m3u8: + github: akiicat/m3u8 crystal: 1.4.0 diff --git a/src/database.cr b/src/database.cr new file mode 100644 index 0000000..ff92a01 --- /dev/null +++ b/src/database.cr @@ -0,0 +1,2 @@ +# Here everything for supporting persistent storage will be saved +# Being it postgresql or sqlite diff --git a/src/hosts/M3U8.cr b/src/hosts/M3U8.cr index 0b08016..9233013 100644 --- a/src/hosts/M3U8.cr +++ b/src/hosts/M3U8.cr @@ -2,3 +2,17 @@ # Input # swapper.cr # Output +require "m3u8" + +module Local_M3U8 + include M3U8 + # Read Playlist + file = File.read "spec/playlists/master.m3u8" + playlist = Playlist.parse(file) + playlist.master? # => true + + # Generate playlist/stream + playlist = Playlist.new + playlist.items << SegmentItem.new(duration: 10.991, segment: "test_01.ts") + playlist.to_s +end