testing m3u8 lib-module
This commit is contained in:
parent
22e5dd2e03
commit
964c9b12a4
4 changed files with 21 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@
|
|||
/bin/
|
||||
/.shards/
|
||||
*.dwarf
|
||||
*.lock
|
||||
|
|
|
@ -7,6 +7,10 @@ authors:
|
|||
targets:
|
||||
playper:
|
||||
main: src/playper.cr
|
||||
|
||||
dependencies:
|
||||
m3u8:
|
||||
github: akiicat/m3u8
|
||||
|
||||
crystal: 1.4.0
|
||||
|
||||
|
|
2
src/database.cr
Normal file
2
src/database.cr
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Here everything for supporting persistent storage will be saved
|
||||
# Being it postgresql or sqlite
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue