Sunday, 12 March 2017

Youtube api upload video and set paid product placement field

I want to upload a video on Youtube through their api but I can't find the field I need to set to inform youtube that the video has paid product placements Here is my code:

Youtube.videos.insert({
            resource: {
                // Video title and description
                snippet: {
                    title: "Testing YoutTube API NodeJS module",
                    description: "Test video upload via YouTube API",
                    tags: ["music"],
                    defaultLanguage: "en"
                },
                // I don't want to spam my subscribers
                status: {
                    privacyStatus: "private"
                }
            }
            // This is for the callback function
            , part: "snippet,status"

            // Create the readable stream to upload the video
            , media: {
                body: fs.createReadStream(video_path)
            }
        }, (err, data) => {
            if (err) {
                console.log(err);
            }
            else {
                console.log("Done.");
            }
        });

You can find a description of all the fields you can set when you upload a video here.



via Etienne Prothon

No comments:

Post a Comment