You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: javascript/README.md
+16-9Lines changed: 16 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,9 @@ Description: This JavaScript sample performs the following functions:<br>
23
23
<li>It retrieves the channel name and thumbnail of the authenticated user's channel using the API's channels.list method.</li>
24
24
<li>It handles the video upload to YouTube using the resumable upload protocol.</li>
25
25
<li>It polls for the uploaded video's upload and processing status using the API's videos.list method by setting the part parameter value to status.</li>
26
-
</ol><br>
26
+
</ol>
27
27
28
-
The HTML page uses JQuery, the <code>plusone.js</code> and <code>upload_video.js</code> JavaScript files, and the
28
+
The HTML page uses JQuery, the <code>cors_upload.js</code> and <code>upload_video.js</code> JavaScript files, and the
29
29
<code>upload_video.css</code> file to upload a video file to YouTube.<br><br>Note that if you use this code in your own application, you must replace the value of the <code>data-clientid</code> attribute in the code for the Sign-In Button
30
30
with your project's client ID. The only valid JavaScript origin for the client ID in the sample code is
31
31
<code>http://localhost</code>. This means that you could test the sample locally, but it would not work in your
@@ -34,24 +34,31 @@ production application.
34
34
### [Retrieve my uploads](/youtube/api-samples/blob/master/javascript/my_uploads.js)
35
35
36
36
Method: youtube.playlistItems.list<br>
37
-
Description: This code sample calls the API's <code>playlistItems.list</code> method to retrieve a list of
38
-
videos uploaded to the channel associated with the request. The code also calls the <code>channels.list</code>
39
-
method with the <code>mine</code> parameter set to <code>true</code> to retrieve the playlist ID that identifies
40
-
the channel's uploaded videos.
37
+
Description: The JavaScript sample code performs the following functions:<br>
38
+
<ol>
39
+
<li>It retrieves the playlist ID for videos uploaded to the user's channel using the API's <code>channels.list</code> method. This API call also sets the <code>mine</code> parameter to <code>true</code> to retrieve channel information for the authorizing user.</li>
40
+
<li>It passes that ID to the <code>playlistItems.list</code> method to retrieve the videos in that list.</li>
41
+
<li>It displays the list of videos.</li>
42
+
<li>It constructs next and previous page buttons and sets their visibility based on the information in the API response.</li>
43
+
</ol>
44
+
45
+
The HTML page below uses JQuery, the <code>auth.js</code> and <code>my_uploads.js</code> JavaScript files, and a CSS file to display the list of uploaded videos.
41
46
42
47
### [Search by keyword](/youtube/api-samples/blob/master/javascript/search.js)
43
48
44
49
Method: youtube.search.list<br>
45
50
Description: This code sample calls the API's <code>search.list</code> method to retrieve search results associated
46
-
with a particular keyword.
51
+
with a particular keyword. The HTML page below uses JQuery, along with the auth.js and search.js JavaScript files,
52
+
to show a simple search form and display the list of search results.
47
53
48
54
### [Create a playlist](/youtube/api-samples/blob/master/javascript/playlist_updates.js)
49
55
50
56
Method: youtube.playlists.insert<br>
51
-
Description: This sample creates a private playlist and add videos to it. (You could, of course, modify the code so
52
-
that it creates a publicly visible playlist or so that it checks a form value to determine whether the playlist is
57
+
Description: This JavaScript code creates a private playlist and adds videos to that playlist. (You could, of course, modify the code so that it creates a publicly visible playlist or so that it checks a form value to determine whether the playlist is
53
58
public or private.) Note that you need to update the client ID in the <code>auth.js</code> file to run this code.
54
59
60
+
The HTML page below uses JQuery, along with the auth.js and playlist_updates.js JavaScript files, to display a simple form for adding videos to the playlist.
61
+
55
62
### [Calling the Analytics API](/youtube/api-samples/blob/master/javascript/analytics_codelab.js)
0 commit comments