Screen Recorder Tool
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f0f0f0;
}
header {
background-color: #333;
color: #fff;
text-align: center;
padding: 1rem;
}
main {
max-width: 600px;
margin: 0 auto;
padding: 2rem;
background-color: #fff;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 5px;
}
.controls {
display: flex;
justify-content: center;
margin-bottom: 1rem;
}
button {
padding: 0.5rem 1rem;
font-size: 1rem;
background-color: #007bff;
color: #fff;
border: none;
cursor: pointer;
margin: 0 1rem;
border-radius: 5px;
}
button:disabled {
background-color: #ccc;
cursor: not-allowed;
}
video {
width: 100%;
max-width: 600px;
display: block;
margin: 0 auto;
}
let recorder;
document.getElementById("startRecording").addEventListener("click", () => {
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
.then(stream => {
const recordedVideoElement = document.getElementById("recordedVideo");
recordedVideoElement.srcObject = stream;
recorder = RecordRTC(stream, {
type: "video"
});
recorder.startRecording();
document.getElementById("startRecording").disabled = true;
document.getElementById("stopRecording").disabled = false;
})
.catch(error => console.error("Error accessing media devices: ", error));
});
document.getElementById("stopRecording").addEventListener("click", () => {
recorder.stopRecording(() => {
const blob = recorder.getBlob();
const url = URL.createObjectURL(blob);
const recordedVideoElement = document.getElementById("recordedVideo");
recordedVideoElement.src = url;
});
document.getElementById("startRecording").disabled = false;
document.getElementById("stopRecording").disabled = true;
});
Documentation
Step 1:- Open txt file from the folder for code
Step 2:- Copy all code
Step 3:- Open your website dashboard or blog
Step 4:- Add HTML element
Step 5:- Paste all code in your html element
Step 6:- Save file
Done you are successfully Pasted code in your website.
0 Comments