VideoView vs Intent.action_view of user choice - android

I want to play video in my application, but now am confused in different approach to play video in android. Android itself has a feature "VideoView". Shall I implement this videoView or use an Intent.action_view to open the video in the existing player.
I want to know the best approach to follow and the pros and cons of videoView ?
Please guide me!!

Well the best practice, generally, is to use Intent system as much as you can to avoid additional overhead required to implement them yourself when there could, possibly, be better alternatives and to provide users with additional choice. But there might be cases when there is no application available for the required action and hence you'll be needing to implement the task yourself.
My advice is use the intent system, and if no apps were found in user's handset for video playback then you can use VideoView in that case.

No one can tell with out your purpose
1) Based on your requirement you have to choose which one is suitable
2) If you want's to open current video in your own application , you have to use Video view and to Implement controls for Video view , you should use MediaController class
actually this is like createing small video view with minimal options .
3) instead of creating Custom video view you can play selected video using Action.View , but that some of Video player should have in your device .here your opeing in your video in other application , depends on that application you can show more options for video accessing .

Well, there is no right or wrong way here.
It really depends on what you want to do. If the user of your app should only be able to watch the video and your app doesn't need to interact in any way during the playback or needs any information about whether or how the user watched the video, then an intent would probably suffice. And it's less work.
If you want to provide any additional features during the playback a VideoView would be better (and it's really not that much work to implement a simple videoview). Also with an intent you don't know what app the user will choose to open the video, so you have no guarantee how the user will experience your video...
If you implement your own video view you have full control, how it works and how it looks.
So if it's not the core functionality and you only want to show a video once or so, an intent is probably a good way. If it's an important part of your app and you might want to add features and if it would be a bad experience for the user if s/he chose a bad video player, I would definitely recommend doing the little extra work and impl your own video viewer activity...

Related

How to play YouTube video in react native Android app without YouTube branding?

We want to play some YouTube videos in my React Native app without YouTube branding. We would like to give the user experience as if the video is playing in a native player. We already tried with webview, react-native-youtube-iframe but still, we are not able to achieve our goal. Either top or bottom section has a YouTube logo, then watch and share options are visible. We want to eliminate those. Any possible way to do this in React Native?
URLs of Youtube videos are different for normal videos and embedded videos.
Normal: https://www.youtube.com/watch?v=DGQwd1_dpuc
Embed: https://www.youtube.com/embed/DGQwd1_dpuc
Please change 'watch?v=' with '/embed/'.
You can also hide controls and information by passing 'showinfo=0' or 'controls=0'.
I recently tried to achieve the similar thing in one of my android app if you can somehow use this particular library
This is an android library and as you mentioned you want to do it in android.
android-youtube-player
I have used this library where i used a player with custom control which helps you override the controls and also this share and next button and even the youtube logo.
Let me know if you need any help further.
Edit:
To enable web UI
IFramePlayerOptions options = new IFramePlayerOptions.Builder().controls(1).build();
Then initialize the player with this controls.
You won't see any logo now.

Implementing youtube bookmarks app on Android

I'd like to implement bookmarks app allowing to save a bookmark for a particular moment in a youtube video so that it would be possible to jump back to the given second of the video.
I'd like it to be seamlessly integrated with the native youtube app. Is it possible to create a transparent layer on top of youtube app so that I could add this kind of functionality? I mean kind of button in the corner of the screen allowing to save the exact moment of the video. To do that I need to know what youtube video is being watched and what is the moment? Is it doable?
I have no experience with android development, but I'm a skilled Java programmer.
This is a link to a youtube video which takes you directly to a certain moment in the video: https://theyoutubevideolink?t=36m42s (Note everything after ?)
This also works on the current Android YouTube App you can click on the link and it will directly take you to the moment. So it is possible to simply save that link to an external overlay/database.
But before thinking about that you understand Root permission is needed to be able to do this as an overlay. If you are fine with this, it is doable there are many open source YouTube apps with changes made to them on XDA Developers for example, and a simple database addition can the trick for this.
[EDIT]
Well I just went on the YouTube app and you cant hold a time-link like for example on LinusTechTips new video on mobile if you scroll down to the comments you will see many comment showing 0:55 which if you click on can take you directly to that moment in the video. Because we cant hold or anything else than just click, You will need to re-write so you can highlight etc.. which is why i mentioned before about having root access since you cant install third party YouTube apps it has to be re-written and just made into another app. To start you off check this re-written YouTube app called SkyTube: https://github.com/ram-on/SkyTube

Convert a website to Android app allowing background playback

I want to know if there is an easy way for someone with almost inexistent coding skills to create this simple app. The only thing this app will do is act like a browser for a specific site and it will allow playback EVEN when the screen is off or the user has pressed the home button. So if a youtube video starts playing, it will be keep playing in the background if for example the user goes to another app.
Thank you very much for you app!
I think the easier and the most user-friendly way to do this is by using a front-end framework like Bootstrap...

subcribe to channel and like/dislike youtube video programmatically android

How to achieve from an android application which can subscribe, like or dislike a particular youtube video from android application side. And yes this is not so far, i also want callback for all of them like once user has like video then i want callback of that, too. I have searched and got some idea about YouTube Data API,but how to integrate it in my own app that is what i am confused. And is there any else way to achieve this, if someone have then kindly let me know.
To get ratings (like or dislike) you have to to take the video_ID and make a separate API request to get the details you want for the video.
Here are some of the Listener, you may use this specially for loading, playing and controlling video callback: https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayer#Overview
You may use the 'Get Started', The document will help you to set up your development environment and use the Youtube Android Player API.

How to stream screen content to Chromecast

I have an Android app that I would like to add the ability for the user to "cast" what is displayed on the app to a Chromecast. It could just be a local JPG but I would prefer the user to actually see actual "live" content of the app. Does anyone know if this is possible? I know there are apps like AllCast but wasn't sure if they were using supported features of the SDK or if it was a hack. I found some mention of the Default Media Receiver but could not find any documentation on how to use it with local content. Any advice or direction would be appreciated.
There is no Cast api to do that directly; you can look into WebRTC or something of that nature.
The way I do it is to use the Presentation class. The only problem is that you do need to use the ChromeCast app to start screen mirroring before you start your app.
I have not yet found a way to start mirroring my app (or, to be more precise, to show the contents of your Presentation class) from a ChromeCast UIButton within my app, even though I have been able to get that cast button working and connecting ... just not to start app-mirroring when using only my in-app chromecast button.

Categories

Resources