I'd like to know if there is a way to get current frame as a bitmap from an integrated yoube player from a youtubePlayerFragment.
I didn't find such method, and I already tried to extract a bimap from fragment's view but the bitmap doesn't contains the drawing elements from the video I only have buttons and progress bar. Any one knows how to get it?
Regards,
I took a look at the reference found in Package Summary for Youtube API and it seems this feature is not yet supported.
Also, I found this thread that this kind of action may be violating Youtube's terms.
Related
I have a case, when we touch an object let's say a textview, then the object reactions after I touch it moved to another layout, I have a case example on a video on youtube, here is a youtube video url https://www.youtube.com/watch?v=jyhtRr3y_7U. From the video, the app uses what method to move such an object?
please help me to solve this case. I'm deadlocked thinking about what method they use.
There is no single method to perform all these animations, Android gives you flexibility to perform a lot of animations and they have provided helper classes as well but you will have to figure out how and where to use them. To make an app like the one in video you will have to combine a lot of animations. You can start reading about ObjectAnimator, ValueAnimator, SharedElementTranistion, SceneTransition. Here are some tutorials which you can check out
https://www.raywenderlich.com/173345/android-animation-tutorial-with-kotlin
https://www.bignerdranch.com/blog/building-animations-android-transition-framework-part-1/
http://mikescamell.com/shared-element-transitions-part-1/
Im working on a roku app using scene graph component. I am facing many issues like...
During video buffering i want to pause video. Im using this code but not working
video.control = "pause"
During video buffering a blank screen is displaying. I want to show last video image instead of blank screen.
I want to show dialog box to check internet connection on splash screen.
Is this possible to use BrightScript component like "roImageCanvas" or "roListScreen" in scene graph component?
Since Im working first time on brightscript so i don't know does roku supports this type of job or not.
Please suggest any ideas to fix the above issues.
Thank you
1) Not sure what's causing it for you, please share the code for better help.
2) I don't think Scene Graph enables you to do that yet! Couldn't find any reference to any such ability.
3) In your main.brs, at the very beginning you can use Dialog node to show a dialog box, to show message or to take input (buttons), and to check for the network you can use the method GetLinkStatus() of the object roDeviceInfo.
4) For all the substtues for Brightscript Components, look up here: https://sdkdocs.roku.com/display/sdkdoc/Transitioning+to+Scene+Graph
On Video players such as Youtube, I often see that when the user taps on the video view a sort of overlay shows up where the user can choose actions like: “share”, “add to playlist”, “pause”, etc. Basically it’s whatever the developer wants. The developer seems to be able to choose what the icons are, where they go, etc.
I would like to know how it’s done. For example, are they using a VideoView with an overlay? Are they using a FrameLayout with a VideoView and a RelativeLayout on top of the VideoView? I just need some advice in the right direction as I don’t know where to start. Thanks. For simplicity, I am looking to add a Youtube style video player to my activity. And by Youtube style, I am referring to the aforementioned interactions.
I would like to know how it’s done
I am sure that the implementation varies widely.
For example, are they using a VideoView with an overlay?
AFAIK, few professional-grade apps use VideoView, simply because VideoView offers little in the way of events or control. More likely, they are using something else backed by MediaPlayer or third-party media libraries (e.g., ExoPlayer).
Are they using a FrameLayout with a VideoView and a RelativeLayout on top of the VideoView?
No, because that would be two VideoView widgets. However, whatever their video surface is probably resides in a RelativeLayout or FrameLayout, with the overlay as another child of that same container, though I am sure that there are other approaches.
You are welcome to use uiautomatorviewer to try to learn more about the view hierarchy of particular apps of interest.
I am trying to play videos in my listview just like Vine or Instgram. I have been trying to use TextureView with a media player except that when attaching TextureView to the media player I experience issues where the textureview is not being reused properly by the GetView method. The textureview renders some old incorrect videos when scrolling down in my list.
Does anyone know how to play videos in ListViews (Not using VideoView!!!)??
Just wanna give you advice.
You can use WebView inside listview item and using javascript to play the video. you can find the javascript play on html
http://www.w3schools.com/tags/av_prop_autoplay.asp
I hope my advice may help you something out.
Found the solution to this problem. I need to use TexutreView with MediaPlayer, and I need to dynamically add the TextureView to each item in the list. I also need to make sure that I remove any previous TexutreViews that was previously attached to the item in the list before adding a new one dynamically. Also, I need to make sure that I only play one MediaPlayer at a time in the listview to avoid causing any strange behaviors (i.e. videos can play in the wrong position).
You really need to use TextureView. There is actually few problems you need to solve.
Please find expanded answer here:
Run media file in CardView layout
In my spare time I'm learning android. I want to create a layout with a background image which includes an animation.
I know how to use linearLayout.setBackgroundDrawable(R.drawable.BlaBla) but if I place a gif image it becomes a static image but not animated. Also, I'm not sure if I can play a video on it. Can anyone post a simple code or just give the directions about that if possible? Minsdk version will be 8 (2.2).
PS: I know I can use media to play videos using VideoView but it's not a layout, therefore, I can't add some views on it. Please don't suggest that.
I don't think you can just use gif.
Maybe this will help if you want to animate something:
http://developer.android.com/guide/topics/resources/animation-resource.html
With video, I think you should not just put it in background but use media player and then perhaps have some layouts on top if you want to overlay it with some info.
Hope this helped.
Maybe you can try a webView, I've never tested that:
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://img.gif");