This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from haxzie/dev
Release Extended Stream Limit
- Loading branch information
Showing
11 changed files
with
165 additions
and
44 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,36 +1,28 @@ | ||
import React, { useState } from 'react' | ||
import styles from "./styles.module.scss" | ||
import React, { useState } from "react"; | ||
import styles from "./styles.module.scss"; | ||
|
||
export default function Timer({ seconds }) { | ||
export default function Timer({ seconds, maxLimit }) { | ||
const format = (time) => { | ||
// Hours, minutes and seconds | ||
var hrs = ~~(time / 3600); | ||
var mins = ~~((time % 3600) / 60); | ||
var secs = ~~time % 60; | ||
|
||
/** | ||
* Returns minutes from the given seconds | ||
*/ | ||
const getMinutes = () => { | ||
if (seconds) { | ||
const minutes = Math.trunc(seconds/60); | ||
return minutes < 10 ? `0${minutes}`: `${minutes}`; | ||
} else { | ||
return `00`; | ||
} | ||
// Output like "1:01" or "4:03:59" or "123:03:59" | ||
var ret = ""; | ||
if (hrs > 0) { | ||
ret += "" + hrs + ":" + (mins < 10 ? "0" : ""); | ||
} | ||
ret += "" + mins + ":" + (secs < 10 ? "0" : ""); | ||
ret += "" + secs; | ||
return ret; | ||
}; | ||
|
||
/** | ||
* returns the seconds part within 60 from the given total seconds | ||
*/ | ||
const getSeconds = () => { | ||
if (seconds) { | ||
const ts = seconds%60 | ||
return ts < 10? `0${ts}` : `${ts}`; | ||
} else { | ||
return `00`; | ||
} | ||
} | ||
|
||
|
||
return ( | ||
<div className={styles.timer}> | ||
<span>{getMinutes()}:{getSeconds()}</span> | ||
</div> | ||
) | ||
return ( | ||
<div className={styles.timer}> | ||
<span> | ||
{format(seconds)}<span style={{ opacity: "0.5"}}>/{format(maxLimit)}</span> | ||
</span> | ||
</div> | ||
); | ||
} |
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,6 @@ | ||
const config = { | ||
STREAM_LIMIT: 14400, | ||
SAVE_BROADCAST_TO_STORIES: false | ||
} | ||
|
||
export default config; |
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 @@ | ||
export const STREAM_LIMIT = 14400; // 4 hours in seconds |