I have a listview/Recyclerview. Each rows contain Youtube video panel. I am able to display a list of videos in listview. So now user have to click on play button and stop for pause video.
But i am trying auto play one video at a time when it visible to user and auto stop when user scroll down. I looked at but not having solution .
Automatically Playing video in listview/scrollview similar to facebook
Kinldy help me!
Add this library to your project
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.waynell:VideoListPlayer:1.4'
}
source : https://github.com/waynell/VideoListPlayer
Related
Hello i have problem i want to play video stream from url link but i have some issue after i use complete url link or without blank space exoplayer player library can detected but after i use file url link blank space cannot detected
example
http://www.something.com/folder/hmmm.mp4 //worked success
after i use this
http://www.something.com/folder/hmmm iknow this blank space.mp4// cannot worked
can someone helpme please thanks
I am gonna answer using the code I used to play video at a URL in exoplayer--
String videoURL="https://d17h27t6h515a5.cloudfront.net/topher/2017/April/58ffdcc8_5-mix-wet-and-cry-batter-together-brownies/5-mix-wet-and-cry-batter-together-brownies.mp4" ;
MediaSource mediaSource = ExtractorMediaSource.Factory(new DefaultHttpDataSourceFactory("exoplayer-codelab"))
.createMediaSource(Uri.parse(videoURL));
So you'll have to give the entire address of video along with video type extension to run successfully.
I would like to display the URL preview entered by the user like skype app in . For example if i am entering a youtube url in the skype app to other person , it is automatically displaying the thumbnail preview of that URL entered by the user.
https://www.youtube.com/watch?v=QUgRDYehv0M
When i have entered above url means.. Skype automatically showing the thumbnail preview of that link like below:
Like skype i would like to do in android. Whenever if user enters any url means.. i need to show the preview of an url..
https://play.google.com/store/apps/details?id=com.leocardz.link.preview&feature=search_result
Refered above app.. anyother help or guidance will be helpful.
You can import the library using Gradle :
Simply add the repository to your build.gradle file:
repositories {
jcenter()
maven { url 'https://github.com/leonardocardoso/mvn-repo/raw/master/maven-deploy' }
}
And you can use the artifacts like this:
dependencies {
compile 'org.jsoup:jsoup:1.8.3' // required
compile 'com.leocardz:link-preview:1.2.1#aar'
}
You can refer this link for more details.
Any one knows how to detect click event of play button of iframe/video in HTML which is loaded in web-view.
in HTML Page contains like
<p><iframe width="100%" src="youtube.com/embed/uxpDa-c-4Mc"></iframe></p>
and i need to detect click event of Playvideo button in android webview.
Give the element an id, do the following in Javascript (I am assuming you have JQuery, your question itself is lacking details in many ways as I write this right now, you should really try to give more information in order to get answers).
EDIT: My solution to the iframe/jquery issue would be to use a video element instead of an iframe. Here is how: Show Youtube video source into HTML5 video tag?
We would then continue to use the below JS/JQuery
Example JQuery:
$('play').on("click", function() {
//Do something
});
Example with shortcut implemented:
$('play').click(function() {
//Do something
});
I have one listview of videos.
in this given image one button "MostView Video". when i click on this button then i can get list of mostview video.
so how i can get mostview video?
When you see the video then you can store the value in databse then compare it with all other and which 1 (or 10) is highest then they can see in mostview videos.
Girish
There is one HTML page, streaming a music file and It's working on window but i need to run this html file on android.
also i need to control all the feature of music by javascript function e.g. play,pause,stop, volume up & down.
Can someone give me any idea?
Note : i am new to android but good hand in java. Just going through android tutorial and i came to know this feature can be done using webview. is it ?
Its not clear from the post if its a requirement that you have to play it on a html page or you just want to play the .mp3 file linked from some online page.
However, You can look at this Streaming Audio tutorial as an initial reference. The MediaPlayer API would be your goto place in android for anything to do with Audio/ Video. WebView is mainly for embedding a browser view within your android App.
Here is an example quite close to the thing you're going to do...
public class MyJSInterface{
private MediaPlayer mp = new MediaPlayer();
....
public void play(String url){
this.mp.setDataSource(url);
this.mp.prepare();
this.mp.start();
// AlterDialog etc.
}
public void stop(){
this.mp.stop();
}
....
}
HTML from your website:
function _play(url){
window.myappname.play(url);
}
function _stop(url){
window.myappname.stop();
}
thing you may need
Android Media