Skip to content

Commit

Permalink
QUACK QUACK QUACK!
Browse files Browse the repository at this point in the history
  • Loading branch information
pekkis committed Nov 11, 2023
1 parent 2244882 commit 8584698
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/services/audio.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import { random } from "./random";

export type QuackCastAudio = {
title: string;
url: string;
attribution: string;
};

export const quackCast: QuackCastAudio = {
const quackCast: QuackCastAudio = {
title: "Kvaakcast",
url: "https://hardcore-react-training.s3.eu-north-1.amazonaws.com/kvaakcast.ogg",
attribution:
"https://en.wikipedia.org/wiki/File:Mallard_(Anas_platyrhynchos)_(W1CDR0001518_BD17).ogg"
};

export const getQuackCast = async (): Promise<QuackCastAudio> => {
return new Promise((resolve) => {
setTimeout(
() => {
resolve(quackCast);
},
random.integer(500, 1000)
);
});
};
13 changes: 13 additions & 0 deletions src/services/video.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { random } from "./random";

export type QuackTubeVideo = {
title: string;
url: string;
Expand All @@ -18,3 +20,14 @@ export const videos: QuackTubeVideo[] = [
"https://en.wikipedia.org/wiki/File:Canard_colvert_femelle_et_ses_petits_(Lac_Archambault,_Qc).webm"
}
];

export const getVideos = async (): Promise<QuackTubeVideo[]> => {
return new Promise((resolve) => {
setTimeout(
() => {
resolve(videos);
},
random.integer(100, 300)
);
});
};

1 comment on commit 8584698

@vercel
Copy link

@vercel vercel bot commented on 8584698 Nov 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.