Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only accept video/mp4 for story uploads
- Loading branch information
1 parent
6da4b03
commit 1d0b1d8
Showing
13 changed files
with
283 additions
and
2 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
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
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
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
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
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
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
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
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,68 @@ | ||
// Copyright 2022 Signal Messenger, LLC | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
declare module 'mp4box' { | ||
interface MP4MediaTrack { | ||
alternate_group: number; | ||
bitrate: number; | ||
codec: string; | ||
created: Date; | ||
duration: number; | ||
id: number; | ||
language: string; | ||
layer: number; | ||
modified: Date; | ||
movie_duration: number; | ||
nb_samples: number; | ||
timescale: number; | ||
track_height: number; | ||
track_width: number; | ||
volume: number; | ||
} | ||
|
||
interface MP4VideoData { | ||
height: number; | ||
width: number; | ||
} | ||
|
||
interface MP4VideoTrack extends MP4MediaTrack { | ||
video: MP4VideoData; | ||
} | ||
|
||
interface MP4AudioData { | ||
channel_count: number; | ||
sample_rate: number; | ||
sample_size: number; | ||
} | ||
|
||
interface MP4AudioTrack extends MP4MediaTrack { | ||
audio: MP4AudioData; | ||
} | ||
|
||
type MP4Track = MP4VideoTrack | MP4AudioTrack; | ||
|
||
interface MP4Info { | ||
brands: Array<string>; | ||
created: Date; | ||
duration: number; | ||
fragment_duration: number; | ||
hasIOD: boolean; | ||
isFragmented: boolean; | ||
isProgressive: boolean; | ||
mime: string; | ||
modified: Date; | ||
timescale: number; | ||
tracks: Array<MP4Track>; | ||
} | ||
|
||
export type MP4ArrayBuffer = ArrayBuffer & { fileStart: number }; | ||
|
||
export interface MP4File { | ||
appendBuffer(data: MP4ArrayBuffer): number; | ||
flush(): void; | ||
onError?: (e: string) => void; | ||
onReady?: (info: MP4Info) => void; | ||
} | ||
|
||
export function createFile(): MP4File; | ||
} |
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
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
Oops, something went wrong.