Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

How to get only short videos in YouTube api3? Desirable Android, Kotlin

$
0
0

I'm making an Android application and connecting YouTube API there and I need to get sort videos that I get.For example: only long, normal videos and only short videos. I'm new to YouTube API, and I don't know how to do it.

Can anyone help?

There is small part of my code:

RetroInstance file code:

import retrofit2.Retrofitimport retrofit2.converter.gson.GsonConverterFactoryobject RetroInstance {    fun retroInstance(): YoutubeService {        return Retrofit.Builder()            .baseUrl("https://www.googleapis.com/youtube/v3/")            .addConverterFactory(GsonConverterFactory.create())            .build()            .create(YoutubeService::class.java)    }}

And YoutubeService code:

import com.example.alaproapp.model.YoutubeModelimport retrofit2.*import retrofit2.http.GETimport retrofit2.http.Queryinterface YoutubeService {    @GET("search")    fun getAllData(        @Query("key") key: String = "key",        @Query("channelId") channelId: String = "UCHVY_-jY-FayjszyX1nlGtQ",        @Query("order") order: String = "date",        @Query("maxResults") maxResult: String = "1800",        @Query("part") part: String = "snippet,id"    ): Call<YoutubeModel>}

I tried to use documentation, but how I mentioned earlier I'm new to this, and I don't understand how to do it.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>