Java Client for Vimeo
- Upload Videos
- List All Videos
- Single Video Details
- Delete Video
- Edit Uploaded Video
- Upload with Thus Protocol
<dependency>
<groupId>io.github.danushka96</groupId>
<artifactId>vimeo-java</artifactId>
<version>0.0.19</version>
</dependency>
implementation 'io.github.danushka96:vimeo-java:0.0.19'
- Create a new API App in Vimeo
- Generate a personal access token with permissions
- Give this key to the Vimeo-java-client
@PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_STREAM_JSON_VALUE)
public Mono<ResponseEntity> uploadFile(@RequestPart("files") Flux<FilePart> filePartFlux) {
VimeoVideoMeta videoMeta = VimeoVideoMeta.builder()
.name("My test video")
.description("Test video description")
.embed(Embed.builder()
.playbar(true)
.volume(true)
.buttons(Buttons.builder()
.hd(true)
.like(false)
.scaling(true)
.share(false)
.watchlater(false)
.fullscreen(true)
.build())
.title(Title.builder()
.portrait(EmbedOptions.HIDE.getValue())
.owner(EmbedOptions.HIDE.getValue())
.name(EmbedOptions.HIDE.getValue())
.build())
.logos(Logos.builder()
.vimeo(false)
.build())
.build()
)
.privacy(Privacy.builder()
.download(false)
.embed(PrivacyScope.WHITELIST.getVal())
.view(PrivacyView.DISABLE.getVal())
.build())
.build();
return filePartFlux
.flatMap(f -> vimeoVideoService.initVideoUploadMeta(videoMeta)
.flatMap(resp -> vimeoVideoService.uploadVideo(resp.getUpload().getUploadLink(), f)
.doOnError(System.out::println)
.doOnNext(System.out::println)))
.then(Mono.just("SUCCESS"))
.doOnError(System.out::println);
}
Feel free to open issues if you face some kind of problem.