Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b7bb0ee
commit e561be4
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* @since 4.2.0 | ||
*/ | ||
|
||
import TestHelpers from '../test-helpers'; | ||
|
||
// registers the plugin | ||
import FFmpegjsEngine from '../../src/js/plugins/ffmpegjs-plugin'; | ||
import {FFMPEGJS} from '../../src/js/engine/convert-engine'; | ||
|
||
/** @test {FFmpegjsEngine} */ | ||
describe('plugins.ffmpegjs-plugin', () => { | ||
let player; | ||
|
||
beforeEach(() => { | ||
// create video-only player with ffmpeg.js plugin | ||
player = TestHelpers.makeConvertPluginPlayer(FFMPEGJS); | ||
}); | ||
|
||
afterEach(() => { | ||
player.dispose(); | ||
}); | ||
|
||
/** @test {FFmpegjsEngine} */ | ||
it('converts', (done) => { | ||
// allow test to fail | ||
pending('disabled until test runner failure is figured out'); | ||
|
||
player.one('deviceReady', () => { | ||
let req = new Request(TestHelpers.TEST_WEBM); | ||
fetch(req).then((response) => { | ||
return response.blob(); | ||
}).then((blob) => { | ||
player.one('finishConvert', () => { | ||
expect(player.convertedData instanceof Blob).toBeTruthy(); | ||
expect(player.convertedData.name).toEndWith('.mp3'); | ||
done(); | ||
}); | ||
player.record().converter.convert(blob); | ||
}); | ||
}); | ||
|
||
player.one('ready', () => { | ||
// start device | ||
player.record().getDevice(); | ||
}); | ||
}); | ||
}); |