Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Playback-win32.zip
Playback.app
Playback.app.zip
.DS_Store
.idea
5 changes: 5 additions & 0 deletions playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ var concat = require('concat-stream')

var noop = function () {}

var allowedExts = ['mpg', 'mkv', 'mp4', 'mp3', 'vtt', 'srt']

module.exports = function () {
var that = new events.EventEmitter()

Expand Down Expand Up @@ -141,6 +143,9 @@ module.exports = function () {

file.length = st.size
file.name = path.basename(link)
file.extension = file.name.split(".").pop().toLowerCase()
if (allowedExts.indexOf(file.extension) === -1) return cb("File format not supported")

file.createReadStream = function (opts) {
return fs.createReadStream(link, opts)
}
Expand Down