@@ -4,6 +4,7 @@ import { expect } from 'chai'
44import SoundCloud from '../src/players/SoundCloud'
55import YouTube from '../src/players/YouTube'
66import Vimeo from '../src/players/Vimeo'
7+ import FilePlayer from '../src/players/FilePlayer'
78
89describe ( 'YouTube' , ( ) => {
910 it ( 'knows what it can play' , ( ) => {
@@ -43,3 +44,21 @@ describe('Vimeo', () => {
4344 expect ( Vimeo . canPlay ( 'https://www.youtube.com/watch?v=1234' ) ) . to . be . false
4445 } )
4546} )
47+
48+ describe ( 'FilePlayer' , ( ) => {
49+ it ( 'knows what it can play' , ( ) => {
50+ expect ( FilePlayer . canPlay ( 'http://example.com/file.mp4' ) ) . to . be . true
51+ expect ( FilePlayer . canPlay ( 'http://example.com/file.ogg' ) ) . to . be . true
52+ expect ( FilePlayer . canPlay ( 'http://example.com/file.ogv' ) ) . to . be . true
53+ expect ( FilePlayer . canPlay ( 'http://example.com/file.webm' ) ) . to . be . true
54+ expect ( FilePlayer . canPlay ( 'http://example.com/file.mp3' ) ) . to . be . true
55+ expect ( FilePlayer . canPlay ( 'http://example.com/file.wav' ) ) . to . be . true
56+ } )
57+
58+ it ( 'knows what it can\'t play' , ( ) => {
59+ expect ( FilePlayer . canPlay ( 'http://example.com/file.mp5' ) ) . to . be . false
60+ expect ( FilePlayer . canPlay ( 'http://example.com/file.ogh' ) ) . to . be . false
61+ expect ( FilePlayer . canPlay ( 'http://example.com/file.web' ) ) . to . be . false
62+ expect ( FilePlayer . canPlay ( 'http://example.com/file.txt' ) ) . to . be . false
63+ } )
64+ } )
0 commit comments