Skip to content

Commit 08bcbeb

Browse files
"Added sample: javascript/upload_video.html"
1 parent 1e28d18 commit 08bcbeb

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

javascript/upload_video.html

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>YouTube API Uploads via CORS</title>
6+
<link rel="stylesheet" href="upload_video.css">
7+
<link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Open+Sans' type='text/css'>
8+
</head>
9+
<body>
10+
<span id="signinButton" class="pre-sign-in">
11+
<!-- IMPORTANT: Replace the value of the <code>data-clientid</code>
12+
attribute in the following tag with your project's client ID. -->
13+
<span
14+
class="g-signin"
15+
data-callback="signinCallback"
16+
data-clientid="1034451067661-h7v9fipq91k83log7c47f49l1o257rl4.apps.googleusercontent.com"
17+
data-cookiepolicy="single_host_origin"
18+
data-scope="https://www.googleapis.com/auth/youtube.upload https://www.googleapis.com/auth/youtube">
19+
</span>
20+
</span>
21+
22+
<div class="post-sign-in">
23+
<div>
24+
<img id="channel-thumbnail">
25+
<span id="channel-name"></span>
26+
</div>
27+
28+
<div>
29+
<label for="title">Title:</label>
30+
<input id="title" type="text" value="Default Title">
31+
</div>
32+
<div>
33+
<label for="description">Description:</label>
34+
<textarea id="description">Default description</textarea>
35+
</div>
36+
<div>
37+
<label for="privacy-status">Privacy Status:</label>
38+
<select id="privacy-status">
39+
<option>public</option>
40+
<option>unlisted</option>
41+
<option>private</option>
42+
</select>
43+
</div>
44+
45+
<div>
46+
<input input type="file" id="file" class="button" accept="video/*">
47+
<button id="button">Upload Video</button>
48+
<div class="during-upload">
49+
<p><span id="percent-transferred"></span>% done (<span id="bytes-transferred"></span>/<span id="total-bytes"></span> bytes)</p>
50+
<progress id="upload-progress" max="1" value="0"></progress>
51+
</div>
52+
53+
<div class="post-upload">
54+
<p>Uploaded video with id <span id="video-id"></span>. Polling for status...</p>
55+
<ul id="post-upload-status"></ul>
56+
<div id="player"></div>
57+
</div>
58+
<p id="disclaimer">By uploading a video, you certify that you own all rights to the content or that you are authorized by the owner to make the content publicly available on YouTube, and that it otherwise complies with the YouTube Terms of Service located at <a href="http://www.youtube.com/t/terms" target="_blank">http://www.youtube.com/t/terms</a></p>
59+
</div>
60+
61+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
62+
<script src="//apis.google.com/js/client:plusone.js"></script>
63+
<script src="cors_upload.js"></script>
64+
<script src="upload_video.js"></script>
65+
</body>
66+
</html>

0 commit comments

Comments
 (0)