-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport.html
More file actions
305 lines (262 loc) · 10.8 KB
/
Copy pathexport.html
File metadata and controls
305 lines (262 loc) · 10.8 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Export Tools - ScheduleFlow</title>
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body class="theme-black">
<nav class="navbar">
<div class="nav-container">
<h1 class="logo">⚡ ScheduleFlow</h1>
<div class="nav-links">
<a href="index.html" class="nav-link">Hub</a>
<a href="scheduler.html" class="nav-link">Scheduler</a>
<a href="demo.html" class="nav-link">Demo</a>
<a href="calendar.html" class="nav-link">Calendar</a>
<a href="export.html" class="nav-link active">Export</a>
</div>
</div>
</nav>
<main class="container">
<h1>Export Tools</h1>
<p>Export your schedule to various playout engines and formats.</p>
<section class="export-section">
<h2>Supported Export Formats</h2>
<div class="export-card">
<h3>CasparCG Format</h3>
<p>Professional playout engine XML format for broadcast facilities.</p>
<button class="btn-primary" onclick="exportTools.exportCasparCG()">Export for CasparCG</button>
</div>
<div class="export-card">
<h3>OBS (Open Broadcaster Software)</h3>
<p>Playlist format compatible with OBS streaming engine.</p>
<button class="btn-primary" onclick="exportTools.exportOBS()">Export for OBS</button>
</div>
<div class="export-card">
<h3>M3U Playlist</h3>
<p>Standard M3U8 playlist format for media players.</p>
<button class="btn-primary" onclick="exportTools.exportM3U()">Export M3U</button>
</div>
<div class="export-card">
<h3>JSON Schedule</h3>
<p>Structured JSON format for programmatic access.</p>
<button class="btn-primary" onclick="exportTools.exportJSON()">Export JSON</button>
</div>
</section>
<section class="export-section">
<h2>Preview & Copy</h2>
<div class="preview-container">
<textarea id="exportPreview" placeholder="Select an export format to see preview..." readonly rows="12"></textarea>
</div>
<div class="controls">
<button class="btn-secondary" onclick="exportTools.copyPreview()">📋 Copy to Clipboard</button>
<button class="btn-secondary" onclick="exportTools.clearPreview()">Clear</button>
</div>
</section>
<section class="export-section">
<h2>Export Configuration</h2>
<div class="config-form">
<label>
Channel Name:
<input type="text" id="channelName" value="ScheduleFlow Channel" placeholder="Your channel name">
</label>
<label>
Include Metadata:
<input type="checkbox" id="includeMetadata" checked>
</label>
<label>
Time Zone:
<select id="timezone">
<option value="UTC">UTC</option>
<option value="EST">EST</option>
<option value="CST">CST</option>
<option value="MST">MST</option>
<option value="PST">PST</option>
</select>
</label>
</div>
</section>
</main>
<footer>
<p>© 2025 ScheduleFlow. Professional Export Ready.</p>
</footer>
<script>
const exportTools = {
getSampleSchedule() {
return JSON.parse(localStorage.getItem('scheduleData') || '[]') || [
{ time: '08:00', item: { title: 'Breaking Bad S01E01', url: 'http://example.com/bb1.mp4' } },
{ time: '09:00', item: { title: 'Documentary 01', url: 'http://example.com/doc1.mp4' } },
{ time: '10:00', item: { title: 'Classic Film 1', url: 'http://example.com/film1.mp4' } }
];
},
exportCasparCG() {
const schedule = this.getSampleSchedule();
const channel = document.getElementById('channelName').value;
let xml = '<?xml version="1.0" encoding="UTF-8"?>\n';
xml += '<Channel>\n';
xml += ` <Name>${channel}</Name>\n`;
xml += ' <Playlists>\n';
for (let slot of schedule) {
xml += ' <Clip>\n';
xml += ` <Time>${slot.time}</Time>\n`;
xml += ` <Title>${this.escapeXml(slot.item.title)}</Title>\n`;
xml += ` <URL>${this.escapeXml(slot.item.url)}</URL>\n`;
xml += ' </Clip>\n';
}
xml += ' </Playlists>\n';
xml += '</Channel>';
document.getElementById('exportPreview').value = xml;
this.showMessage('CasparCG format generated');
},
exportOBS() {
const schedule = this.getSampleSchedule();
let obs = '{\n';
obs += ' "scenes": [\n';
obs += ' {\n';
obs += ' "name": "ScheduleFlow Broadcast",\n';
obs += ' "sources": [\n';
for (let i = 0; i < schedule.length; i++) {
const slot = schedule[i];
obs += ` {\n`;
obs += ` "id": "source_${i}",\n`;
obs += ` "name": "${slot.item.title}",\n`;
obs += ` "type": "media_source",\n`;
obs += ` "file": "${slot.item.url}",\n`;
obs += ` "start_time": "${slot.time}"\n`;
obs += ` }${i < schedule.length - 1 ? ',' : ''}\n`;
}
obs += ' ]\n';
obs += ' }\n';
obs += ' ]\n';
obs += '}';
document.getElementById('exportPreview').value = obs;
this.showMessage('OBS format generated');
},
exportM3U() {
const schedule = this.getSampleSchedule();
let m3u = '#EXTM3U\n';
for (let slot of schedule) {
m3u += `#EXTINF:-1,${slot.item.title}\n`;
m3u += `${slot.item.url}\n`;
}
document.getElementById('exportPreview').value = m3u;
this.showMessage('M3U format generated');
},
exportJSON() {
const schedule = this.getSampleSchedule();
const channel = document.getElementById('channelName').value;
const includeMetadata = document.getElementById('includeMetadata').checked;
const timezone = document.getElementById('timezone').value;
const json = {
channel: channel,
timezone: timezone,
exported: new Date().toISOString(),
schedule: schedule,
metadata: includeMetadata ? {
total_items: schedule.length,
duration_hours: 24,
format_version: '1.0'
} : undefined
};
document.getElementById('exportPreview').value = JSON.stringify(json, null, 2);
this.showMessage('JSON format generated');
},
copyPreview() {
const preview = document.getElementById('exportPreview');
preview.select();
navigator.clipboard.writeText(preview.value).then(() => {
this.showMessage('Copied to clipboard!');
});
},
clearPreview() {
document.getElementById('exportPreview').value = '';
},
escapeXml(str) {
return str.replace(/[<>&'"]/g, (c) => {
switch (c) {
case '<': return '<';
case '>': return '>';
case '&': return '&';
case '"': return '"';
case "'": return ''';
default: return c;
}
});
},
showMessage(msg) {
const status = document.createElement('div');
status.style.cssText = 'position: fixed; top: 20px; right: 20px; background: #00ff00; color: #000; padding: 1rem; border: 2px solid #ffff00; z-index: 1000;';
status.textContent = msg;
document.body.appendChild(status);
setTimeout(() => status.remove(), 3000);
}
};
</script>
<style>
.export-section {
margin: 3rem 0;
padding: 2rem;
border: 2px solid #00ff00;
background-color: #1a1a1a;
}
.export-section h2 {
color: #ffff00;
margin-bottom: 2rem;
}
.export-card {
background-color: #333;
border: 1px solid #00ff00;
padding: 1.5rem;
margin-bottom: 1.5rem;
transition: all 0.3s;
}
.export-card:hover {
border-color: #ffff00;
background-color: rgba(255, 255, 0, 0.05);
}
.export-card h3 {
color: #ffff00;
margin-bottom: 0.5rem;
}
.export-card p {
color: #00ff00;
margin-bottom: 1rem;
font-size: 0.95rem;
}
.preview-container {
margin: 1.5rem 0;
}
.controls {
display: flex;
gap: 1rem;
flex-wrap: wrap;
margin-top: 1.5rem;
}
.config-form {
display: flex;
flex-direction: column;
gap: 1rem;
}
.config-form label {
display: flex;
gap: 0.5rem;
align-items: center;
color: #00ff00;
}
.config-form input,
.config-form select {
flex: 1;
}
@media (max-width: 768px) {
.export-section {
padding: 1rem;
}
.controls {
flex-direction: column;
}
}
</style>
</body>
</html>