I want to integrate YouTube videos in my app along with the Ads which are shown while watching the videos on YouTube app.
So I would like to know whether using YouTubePlayerView will solve my problem or do I have to use YouTubeIntents to redirect user to YouTube app in order to preserve the Ads which YouTube adds to the videos
You may refer with this thread. It stated that YouTubePlayerView shows Ad word in the screen. Also, to enable ads, call the videoAdvertisingOptions.update method. In your request, set the videoId parameter to the broadcast id that you obtained. Use the videoAdvertisingOption resource's adFormats[] property to identify the ad formats (preroll, midroll, or postroll) that you want to enable.
Related
Is there a way to know if an ad being played currently is Pre-roll, Mid-roll or Post-roll. I can't seem to find a listener that exposes this information.
I am currently using the IMA ads event listener on the ImaAdsLoader:
imaAdsLoader.addCallback(VideoAdPlayer.VideoAdPlayerCallback);
I'm using IronSource for mediating rewards video. The first time it works OK but there's no way of loading the reward video second time without killing the app.
I checked their SDK and there's no loadReward or requestReward in their API. The first video loads automatically when IronSource.init(context, mAppKey, IronSource.AD_UNIT.REWARDED_VIDEO) is called.
How can I load the second reward video?
Try checking the capping and pacing settings - that could be why you're having issues.
You can also use:
boolean available = IronSource.isRewardedVideoAvailable();
to check if you have availability for rewarded video.
am working on youtube player using youtube v3 api. I tried to add video duration using part=ContentDetails to my video search request, but it keeps returning error for contentDetails/duration. Does anybody have any means of getting around this problem. Here is my search request Url code below.
https://www.googleapis.com/youtube/v3/search?contentDetailsorder=viewCount&q=;&type=video&maxResults=14&part=snippet,&fields=items(id/videoId,snippet/title,snippet/thumbnails,contentDetails/duration)&key= Constants.YOUTUBE_API_KEY;
The Search:List call does not return the duration of a video in its search results. All the fields available can be seen here.
In order to get the duration of the videos call Videos:List with the id field set to a comma delimited list of the videoIds that you get from the search call. For instance:
GET https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id=RgKAFK5djSk%2Cw1oM3kQpXRo&key={YOUR_API_KEY}
you can then access contentDetails\Duration for each of the videos.
I'm currently developing an android mobile app. I see that private Vimeo videos are not playing. Check the attached screen shot. Also note that the android app is still on development mode and not uploaded to Google. Please help me in this regard.
Regards,
Niladri!
private vimeo video not playing
That picture appears to be accessing vimeo.com directly to view videos. At vimeo.com, private videos can only be viewed if you are logged in (which is unrelated to the API).
If you want to play a private video in your application you will need to follow one of the following workflows:
Embedded in a webview
Mark your video as hidden from vimeo, yet embeddable, in your video's settings
Make an API request to /videos/{video_id} and extract the embed code from the response body (response.embed.html)
Put the embed code in your webview's html
Played in the Native Player (Vimeo PRO only)
Mark your video with any privacy setting
Make an API request to /videos/{video_id}
Find the collection of video files (response.files)
Loop through the video files to find the best height and width for your target player
Load the link into your native player
You can read more about the Vimeo API at https://developer.vimeo.com/api, and https://developer.vimeo.com/api/endpoints
If you want to play private Vimeo videos of your Vimeo account in an Android Application then follow the steps below:
Go to your video privacy settings and mark it as hidden from Vimeo and embed anywhere.
Make an API request to this endpoint: https://api.vimeo.com/users/{your_user_id}/videos
Get the embed.html string from the API response.
Load embed.html obtained in the previous step into your WebView.
For Vimeo Android SDK: https://github.com/vimeo/vimeo-networking-java
You can retrieve the Video endpoint by calling an auth-enabled REST API and then play it using a player(I used Exoplayer in android).
Follow below steps:
API Registration: You will need an application registered with the Vimeo API. If you do not already have an application registered, you can do so here.
You can generate an access token in the Authentication tab once you select your app from the list here.
With this access token you'll be able to make any requests that the access token's scope allows. You will NOT be able to switch accounts if you only supply the access token.
Call rest API with the access token in the header like below
Endpoint:
https://api.vimeo.com/videos/{VIDEO_ID}
Header:
Authorization:bearer ACCESS_TOKEN
VIDEO_ID is the id of video uploaded to Vimeo(Some number eg: 45334535)
ACCESS_TOKEN is the token you got after API Registration
This steps worked for me. I hope this will help someone.
We have a special google's SDK for YouTube for instance. On the other side AOS does not support Adobe Flash. Maybe its just has an unsupported by AOS video codec used by vimeo service? That could be the reason why you cant watch vimeo videos via WebView/browser.
Did you check for Vimeo official Android SDK if such thing does exist at least?
Also check this
And a little suggest: try to use SO search and google - it helps in most cases :)
Chrome (for Android) now overlays a Cast button on all HTML5 video content that it finds. The problem is that the content on our site requires authentication to view. Tapping the Cast button shows this toast:
"Unable to cast video due to site restrictions"
Is there a way to...
a) Provide the cast button with the necessary authentication params
and if not (a), then:
b) Provide a meta tag telling Chrome not to put a Cast button on our videos
We plan to provide Chromecast functionality in our Android app, but it's not done yet.
I think that you should add Access-Control-Allow-Origin: * to your CDN. look at this: https://developers.google.com/cast/docs/player check out the CORS Reference.
Works for me.