making simpler with content instead of audioclips
This commit is contained in:
@@ -11,32 +11,28 @@ export interface IContent {
|
||||
|
||||
// ? persist length of clip for easier viewing for others...
|
||||
// ?they have to load it anyway and will get metadata anyway?
|
||||
export class AudioClip implements IContent {
|
||||
export class ContentBlock implements IContent {
|
||||
id: string;
|
||||
|
||||
constructor(
|
||||
public creatorUserId: string,
|
||||
public contentUrl: string,
|
||||
|
||||
public contentType: ContentType,
|
||||
public blobType: string,
|
||||
|
||||
public createdDate: Timestamp = Timestamp.now(),
|
||||
) {}
|
||||
}
|
||||
|
||||
export class Link implements IContent {
|
||||
id: string;
|
||||
constructor(
|
||||
public creatorUserId: string,
|
||||
public contentUrl: string,
|
||||
public createdDate: Timestamp = Timestamp.now(),
|
||||
) {}
|
||||
export enum ContentType {
|
||||
audio = 'audio',
|
||||
|
||||
link = 'link',
|
||||
|
||||
image = 'image',
|
||||
}
|
||||
|
||||
export class Image implements IContent {
|
||||
id: string;
|
||||
|
||||
constructor(
|
||||
public creatorUserId: string,
|
||||
public contentUrl: string,
|
||||
public thumbnailUrl?: string,
|
||||
public createdDate: Timestamp = Timestamp.now(),
|
||||
) {}
|
||||
export function isUrlImage(url: string) {
|
||||
return url.match(/\.(jpeg|jpg|gif|png)$/) != null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user