How To Display Youtube Video Thumbnail? - android-youtube-api

I have a fragment with a ScrollView and I want to display the YouTube thumbnail of a video as one of the items in the scrollview.
I looked up everywhere but couldn't understand how to, I really need the base.
Please help me, I'm stuck like this for days...
This method supposed to take the VIDEO_ID(from YouTube) and take it's thumbnail.
This thumnbail should be displayed in youTubeThumbnailView.
Here is something I tried:
public void getThumbnail(){
String VIDEO_ID = "xxxxxx";
YouTubeThumbnailView youTubeThumbnailView = new YouTubeThumbnailView(getActivity());
youTubeThumbnailView = (YouTubeThumbnailView)youTubeThumbnailView.findViewById(R.id.thumbnail);
youTubeThumbnailView.//Dont know how to continue :(.
}

Take a look at the updated version of the youtube-android sdk (version 1.2.1 released on 22 Jan 2015).
The changelog states something interesting about thumnails:
The YouTubeThumbnailLoader interface's documentation has been updated to note that you must call the interface's release() method when you are finished with the YouTubeThumbnailLoader. The documentation for the YouTubeThumbnailView class also mentions this requirement.

Related

How to custom WebRTC video source?

Does someone know how to change WebRTC (https://cocoapods.org/pods/libjingle_peerconnection) video source?
I am working on an screen sharing app.
At the moment, I retrieve the rendered frames in real-time in CVPixelBuffer. Does someone know how I could add my frames as video source please?
Is it possible to set an other video source instead of camera device source ? Is yes, which format the video has to be and how to do it ?
Thanks.
var connectionFactory : RTCPeerConnectionFactory = RTCPeerConnectionFactory()
let videoSource : RTCVideoSource = factory.videoSource()
videoSource.capturer(videoCapturer, didCapture: videoFrame!)
Mounis answer is wrong. This leads to nothing. At least not at the time of this writing. There is simply nothing happening.
In fact, you would need to satisfy this delegate
- (void)capturer:(RTCVideoCapturer *)capturer didCaptureVideoFrame:(RTCVideoFrame *)frame;
(Note the difference to the Swift version: didCapture vs. didCaptureVideoFrame)
Since this delegate is for unclear reasons not available at Swift level (the compiler says you have to use didCapture, since it has been renamed from didCaptureVideoFrame with Swift3) you have to put the code int an ObjC class. I did copy this and this (which is a part of this sample project)into my project, made my videoCapturer an instance of ARDBroadcastSampleHandler
self.videoCapturer = ARDExternalSampleCapturer(delegate: videoSource)
and within the capture callback I'm calling it
let capturer = self.videoCapturer as? ARDExternalSampleCapturer
capturer?.didCapture(sampleBuffer)

Setting "origin" in youtube-ios-player-helper breaks programatic functionality

Using the YouTube iOS Player Helper library (https://github.com/youtube/youtube-ios-player-helper downloaded on 2015-06-16), if I add the line:
#"origin": #"example.com",
before:
#"modestbranding": #1
at line 30 in SingleVideoViewController.m, then the programatic controls no longer function to affect the video, and the progress bar no longer updates. Additionally, very few of the status messages are being shows/received.
I assume/hope "origin" would show up in analytics, to signify source, which is why I'm setting it.
Is there a specific format this text needs to be in, or something else I should be setting?
I'm cross posting this issue here as I have got no response to the GitHub issue
https://github.com/youtube/youtube-ios-player-helper/issues/121
You are not passing in a valid url for the origin parameter.
Try #"origin": #"https://example.com" or #"origin": #"http://example.com". Note the http(s)://.

ROKU-Using urlTransfer to Call Script File

Not sure how Roku and Brightscript actually works. I need to call a script file just before the channel starts to stream. The script file will convert the stream on fly. I asked how to do this in Roku forum and was told to use urlTransfer. Well, the sdk gives little help that I can see when explaining how to. I ran across this post on stackoverflow:
How to make api request to some server in roku
It gives a good example which I think I understand. My confusion comes in where and how the function is called. It has to happen right before the video url is called so the conversion can start.
Any advice appreciated.
If you are using roVideoPlayer then just before you call the play function and if you are using roVideoScreen then just before the show function.
Example snippet:
roVideoPlayer
player=CreateObject('roVideoPlayer')
* Your code to add content for the player
* Your call to script
player.play()
roVideoScreen
player=CreateObject('roVideoScreen')
* Your code to add content for the player
* Your call to script
player.show()
Hope this helps

YouTube API not returning full description

I'm currently using the YouTube API V2 inside my iOS app, however the description seems to be bugged and cuts off. It never returns the full description. It always stops at .... I've never had this issue before, does anyone know what I'm doing wrong or what YouTube did to their API ?
Here's the API request I'm calling : http://gdata.youtube.com/feeds/api/users/DaveDays/uploads?q=&v=2&start-index=1&max-results=50&orderby=published&time=this_week
Example: Instead of returning this description
This is Dave's reaction/parody to Miley Cyrus video We Can't Stop.
iTunes: https://itunes.apple.com/us/album/we-...
Twitter: http://www.twitter.com/davedays
Facebook: http://www.facebook.com/ddays
Instagram: http://www.instagram.com/davedays
Merch!! http://www.westaspenmerch.com/davedays
Credits:
Chris http://www.youtube.com/iamchrisc
Nikki http://www.youtube.com/nikkinhollywood
Joey: http://www.youtube.com/bambamjoey
Matt: http://www.youtube.com/matthewdamc
Parody of Miley Cyrus' song We Can't Stop! Twerking it upp! Hi Miley Cyrus. We can't stop either. Miley Cyrus.
it returns this one
This is Dave's reaction/parody to Miley Cyrus video We Can't Stop. iTunes: https://itunes.apple.com/us/album/we-cant-stop-parody-single/id685057235 Twitter: ...
If you think its a bug, then check and report it at: https://code.google.com/p/gdata-issues/issues/list?q=label:API-YouTube
If additional parameters changes the request into a search request, then it will give a short description.
The url and basic parameters do return the full description. Like in: http://gdata.youtube.com/feeds/api/users/DaveDays/uploads?v=2&start-index=1&max-results=50
The add of the other parameters seems to be the cause.
But, "time=this_week" seems to give the longer description:
http://gdata.youtube.com/feeds/api/users/DaveDays/uploads?v=2&start-index=1&max-results=50&time=this_week
Since its about the uploads of one channel, an option could be to get all videos first and do ordering and/or filtering yourself, later.

camera programming in black berry

my following code returns null ,
byte[] image1 = _videoControl.getSnapshot(null);
any suggestion please
Few important moments about VideoControl.getSnapshot method:
some manufacturers may not implement getSnapshot() method;
the viewfinder must actually be visible on the screen prior to calling getSnapShot();
if you attempt to take pictures too quickly, however, getSnapShot() may
return null. The camera requires time to clear out its buffer and
prepare for the next shot;
you may check MMAPI System Property for "video.snapshot.encodings" before capturing:
if (System.getProperty("video.snapshot.encodings") == null) {
// getSnapshot() is not supported
}
You may read this chapter from book "Advanced BlackBerry Development":
http://books.google.com/books?id=F4Qu-lpoVncC&pg=PA53&lpg=PA53#v=onepage&q&f=false
Since VideoControl.getSnapshot method is not supported by all devices I'd recommend to use another approach. You can start the native BB Camera app with this line of code:
Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments());
and then using the FileSystemJournalListener catch the taken image.
The BB SDK on your PC contains samples. Search for 'fileexplorerdemo' sample to see the rest of details.

Resources