Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
786 views
in Technique[技术] by (71.8m points)

ios - Youtube video upload using NSURLRequest

I am trying to upload the video to youtube using NSURLRequest. I am able to authenticate and the user and also video gets uploaded, and when checked it says Failed (unable to convert video file) i am not getting what to do, Please usggest

constructed request

Authorization = "Bearer ya29.AHES6ZTQ3rJZaf2g3pIYa_7_myg1N_GvQ4VdmJIcapfoqKIfQf-Iow";
Connection = close;
"Content-Length" = 1848078;
"Content-Type" = "multipart/related; boundary=217NH17UDP";
"GData-Version" = 2;
Host = "uploads.gdata.youtube.com";
Slug = "videoFile.mp4";
"X-GData-Key" = "key=AI39si4b-ta8ku-hbsLt73O0rIlOBjpHbITt8WGrwL7OevwjNjl5EFcowlJlBM6kp3rrU1cw64Vobp1l1lJP31Rqavshl4962A";

--217NH17UDP
Content-Type: application/atom+xml; charset=UTF-8

<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:yt="http://gdata.youtube.com/schemas/2007">
<media:group>
    <media:title type="plain">Sample Video File</media:title>
    <media:description type="plain">
        Description of the sample video
    </media:description>
    <media:category
        scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Music
    </media:category>
    <media:keywords>Keywords</media:keywords>
</media:group>
</entry>
--217NH17UDP
Content-Type: video/mp4
Content-Transfer-Encoding: binary

Video data (NSData)

--217NH17UDP--

as specified in "https://developers.google.com/youtube/2.0/developers_guide_protocol_direct_uploading#Direct_uploading",

Please suggest...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You may wanna set content_type as video/*


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...