| PK | SK | Event Type | TTL |
|---|---|---|---|
| enricoapi | 1659278245 | httperror | 1659278245 |
| enricoapi | 1659628245 | httperror | 1659628245 |
| awesomeapi | 16412278245 | httperror | 16412278245 |
| enricoapi | 1659278666 | httperror | 1659278666 |
This file contains hidden or 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
| function Home() { | |
| const { language, setLanguage } = useContext(UserLanguageContext); | |
| const [selectedLanguage, setSelectedLanguage] = useState(language); | |
| const onLanguageChange = (e) => { | |
| const l = e.target.value; | |
| setSelectedLanguage(l); | |
| I18n.setLanguage(l); | |
| setLanguage(l); |
This file contains hidden or 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
| const defaultLanguage = () => { | |
| const languageFromStorage = localStorage.getItem("lang"); | |
| if (languageFromStorage) { | |
| I18n.setLanguage(languageFromStorage); | |
| return languageFromStorage; | |
| } else { | |
| const detectedLang = navigator.languages | |
| ? navigator.languages[0] | |
| : navigator.language || navigator.userLanguage; | |
| let adaptLang = detectedLang.slice(0, 2); |
This file contains hidden or 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
| import { createContext } from "react"; | |
| const UserLanguageContext = createContext({ | |
| language: "en", | |
| setLanguage: () => {}, | |
| }); | |
| export default UserLanguageContext; |
This file contains hidden or 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
| import { I18n } from "aws-amplify"; | |
| import { Link } from "react-router-dom"; | |
| function About() { | |
| return ( | |
| <section id="aboutSection"> | |
| <p>{I18n.get("aboutTitle")}</p> | |
| <p> | |
| Go to <Link to="/">Home</Link> | |
| </p> |
This file contains hidden or 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
| import _ from "lodash"; | |
| const speakingThreshold = 1000; | |
| const notSpeakingThreshold = 2000; | |
| const audioStream = { | |
| isTalking: false, | |
| timestamp: 0, | |
| }; | |
| const onAudioLevel = function(event, elementId) { |
This file contains hidden or 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
| function findBookByGenreAndYear({genre, startYear, endYear}) { | |
| var params = { | |
| ExpressionAttributeValues: { | |
| ":genre": {"S": genre}, | |
| ":startYear": {"N": startYear}, | |
| ":endYear": {"N": endYear}, | |
| }, | |
| ExpressionAttributesNames:{ | |
| "#genre": "Genre", | |
| "#y": "Year", |
This file contains hidden or 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
| import React, { useCallback, useRef, useState } from "react"; | |
| import OT from "@opentok/client"; | |
| export function usePublisher() { | |
| const [isPublishing, setIsPublishing] = useState(false); | |
| const [pubInitialised, setPubInitialised] = useState(false); | |
| const publisherRef = useRef(); | |
| const streamCreatedListener = React.useCallback(({ stream }) => {}, []); |
This file contains hidden or 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
| let publisher; | |
| const handleError = (e) => console.log(e); | |
| const startScreenShareWithAudio = async () => { | |
| let stream; | |
| try { | |
| stream = await navigator.mediaDevices.getDisplayMedia({video: true, audio: true}); | |
| } catch (e) { | |
| handleError(e); | |
| } | |
| if (stream) { |
This file contains hidden or 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
| const publish = Promise.all([ | |
| OT.getUserMedia({ | |
| videoSource: 'screen' | |
| }), | |
| OT.getUserMedia({ | |
| videoSource: null | |
| }) | |
| ]) | |
| .then(([screenStream, micStream]) => { | |
| return OT.initPublisher(null, { |
NewerOlder