Files
webtorrent-desktop/renderer/lib/torrent-player.js
DC 8108c407d3 Torrent details
Show file list, open folder containing downloaded files, open individual files, play/pause individual videos
2016-03-14 09:18:20 -07:00

14 lines
298 B
JavaScript

module.exports = {
isPlayable: isPlayable
}
var path = require('path')
/**
* Determines whether a file in a torrent is audio/video we can play
*/
function isPlayable (file) {
var extname = path.extname(file.name)
return ['.mp4', '.m4v', '.webm', '.mov', '.mkv'].indexOf(extname) !== -1
}