-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremove-player.html
91 lines (85 loc) · 3.26 KB
/
remove-player.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vimeo Embed Code Modifier</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #333;
}
textarea {
width: 100%;
padding: 10px;
font-size: 16px;
margin-bottom: 10px;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #45a049;
}
.output-container {
position: relative;
margin-bottom: 48px;
}
.copy-btn {
background-color: #008CBA;
}
.copy-btn:hover {
background-color: #007bb5;
}
</style>
</head>
<body style="max-width: 430px;">
<h1>Vimeo Embed Code Modifier</h1>
<p>Enter your Vimeo embed code below:</p>
<textarea id="inputCode" rows="5" placeholder="Paste your Vimeo embed code here..."></textarea>
<h2>Modified Embed Code:</h2>
<div class="output-container">
<textarea id="outputCode" rows="5" readonly></textarea>
<button class="copy-btn" onclick="copyCode()">Copy Code</button>
</div>
<div style="position: relative; padding-bottom: 56.25%; height: 0;">
<p style="font-size: 16px;">How to use this: </p>
<iframe src="https://www.loom.com/embed/3a6c674017e14091b922ca968f5342ee?sid=d5bbf685-9d05-4d1f-ab2a-2d78a7eb5158" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>
<script>
document.getElementById('inputCode').addEventListener('input', modifyEmbedCode);
function modifyEmbedCode() {
const inputCode = document.getElementById('inputCode').value;
const regex = /<iframe.*?src="(.*?)".*?><\/iframe>/;
const match = inputCode.match(regex);
if (match && match[1]) {
let srcUrl = match[1];
const url = new URL(srcUrl);
url.searchParams.set('background', '1');
url.searchParams.set('autoplay', '1');
url.searchParams.set('loop', '1');
url.searchParams.set('muted', '1');
const outputCode = `<iframe src="${url.toString()}" width="640" height="360" frameborder="0" allowfullscreen sandbox="allow-same-origin allow-scripts allow-pointer-lock allow-forms"></iframe>`;
document.getElementById('outputCode').value = outputCode;
} else {
document.getElementById('outputCode').value = 'Invalid embed code.';
}
}
function copyCode() {
const outputCode = document.getElementById('outputCode');
outputCode.select();
outputCode.setSelectionRange(0, 99999); // For mobile devices
document.execCommand('copy');
alert('Copied to clipboard');
}
</script>
</body>
</html>