Skip to content

Adding support for different file types: m4a, mov, ogg and wav. #232

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Binary file added example_files/sample.m4a
Binary file not shown.
Binary file added example_files/sample.mov
Binary file not shown.
Binary file added example_files/sample.ogg
Binary file not shown.
Binary file added example_files/sample.wav
Binary file not shown.
12,317 changes: 6,460 additions & 5,857 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -15,15 +15,19 @@ import xlsx from '../example_files/SimpleSpreadsheet.xlsx';
import photo360 from '../example_files/360photo.jpg';
import avi from '../example_files/drop.avi';
import webm from '../example_files/small.webm'
import mov from '../example_files/step.mov'
// import mov from '../example_files/step.mov'
import mp3 from '../example_files/sample.mp3'
import rtf from '../example_files/sample.rtf';
import pdf from '../example_files/sample.pdf';
import wav from '../example_files/sample.wav';
import ogg from '../example_files/sample.ogg';
import m4a from '../example_files/sample.m4a'
import mov from '../example_files/sample.mov'

ReactDOM.render(
<FileViewer
fileType="xlsx"
filePath={xlsx}
fileType="mov"
filePath={mov}
onGridSort={() => null}
/>,
window.document.getElementById('app')
6 changes: 5 additions & 1 deletion src/components/file-viewer.jsx
Original file line number Diff line number Diff line change
@@ -54,10 +54,14 @@ class FileViewer extends Component {
case 'docx': {
return DocxViewer;
}
case 'ogg':
case 'm4a':
case 'wav':
case 'mp3': {
return AudioViewer;
}
case 'webm':
case 'webm':
case 'mov':
case 'mp4': {
return VideoViewer;
}
2 changes: 1 addition & 1 deletion webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ module.exports = {
enforce: 'pre',
},
{
test: [/\.wexbim$/, /\.jpg$/, /\.docx$/, /\.csv$/, /\.mp4$/, /\.xlsx$/, /\.doc$/, /\.avi$/, /\.webm$/, /\.mov$/, /\.mp3$/, /\.rtf$/, /\.pdf$/],
test: [/\.wexbim$/, /\.jpg$/, /\.docx$/, /\.csv$/, /\.mp4$/, /\.xlsx$/, /\.doc$/, /\.avi$/, /\.webm$/, /\.mov$/, /\.mp3$/, /\.rtf$/, /\.pdf$/, /\.wav$/, /\.ogg$/, /\.m4a$/],
loader: 'file-loader',
},
{