web - Where I can used the title of youtube video and title of resume? -



web - Where I can used the title of youtube video and title of resume? -

i deigning web site candidate can upload video , file. candidate can upload video youtube , has give title of video , same think file has select file , upload server , give title of file.!

enter link description here

this 6 steps , not felling right order of form. should 3 -> 1 -> 2 -> 4 - > 5 -> 6 want should simple candidate fill form simple. need freed order have utilize 1 -> 2 -> 3 -> 4 -> 5 -> 6 in order scare may candidate skip giving title name , move ahead

the page given "mess" (or maybe man wrote article knows doing). sequence not of import @ all. of import step submit video , title info youtube.

here's code letting users submit video specific channel. client side method video info submitted youtube directly, without beingness referred server increment traffic burden.

function uploadvideo() { var metadata = { snippet: { title: document.getelementbyid('title').value, description: document.getelementbyid('descr').value, categoryid: 22 }, status: { privacystatus: "unlisted", license: "youtube" } }; var file = $('#video').get(0).files[0]; $.ajax({ url: 'https://www.googleapis.com/upload/youtube/v3/videos?uploadtype=resumable&part=snippet,status', method: 'post', contenttype: 'application/json', headers: { authorization: 'bearer ' + token, 'x-upload-content-length': file.size, 'x-upload-content-type': file.type }, data: json.stringify(metadata) }).done(function(data, textstatus, jqxhr) { resumableupload({ url: jqxhr.getresponseheader('location'), file: file, start: 0 }); }).fail(function() { }); } function resumableupload(options) { var ajax = $.ajax({ url: options.url, method: 'put', contenttype: options.file.type, headers: { 'content-range': 'bytes ' + options.start + '-' + (options.file.size - 1) + '/' + options.file.size }, xhr: function() { var xhr = $.ajaxsettings.xhr(); if(xhr.upload) { xhr.upload.addeventlistener('progress', function(e) { if(e.lengthcomputable) { var bytestransferred = e.loaded; var totalbytes = e.total; var percentage = math.round((100*bytestransferred/totalbytes)); if(percentage >= 100) percentage = 99; $('#td_submit').text("video uploading ... "+percentage+"%"); } }, false); } homecoming xhr; }, processdata: false, data: options.file }); ajax.done(function(response) { finishupload(response.id);//url of youtube video }); ajax.fail(function() { }); }

there 1 problem involved in question: how upload token. token tells youtube uploading, , channel user uploading to. problem suggest reading page:

https://developers.google.com/youtube/v3/guides/authentication#oauth2_refreshing_a_token

good luck~!

web website

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -