0

I try to make my own YouTube video uploader. My only problem right now is that I can't get the following line of code to work:

InputStreamContent mediaContent = new InputStreamContent(VIDEO_FILE_FORMAT, UploadVideo.class.getResourceAsStream(videopath));

Where VIDEO_FILE_FORMAT is

private static final String VIDEO_FILE_FORMAT = "video/*";

and videopath is the path of the selected video. For example:

C:\Users\totgezockt\Documents\api-samples-master\java\src\main\resources\sample-video.mp4

If I now try to upload the video it says that mediacontent is null.

moritzgrede
  • 3
  • 1
  • 4

0 Answers0