I have created a media player and it is working. The issue I have is that only the video names are displayed in my list view. How can I see the name and a thumbnail image of the video in my list view?
Came across this SO Thread while searching to answer your question. Not sure if that will work on Android or not. You give it a try.
Related
The following question arose. For example, I need to implement file playback by link, but the structure is as follows:
List of artists - Artist - Album - Tracks
The track will be uploaded to the database, and, as intended, will be played by the link.
The question is as follows. How can I try to display a list of artists on the screen first, then by clicking on a certain artist to get to the list of his albums, and from there to the list of album tracks and play it.
Please help me, I can't think of a way to implement this, if at all...
I have array list of videos so users can watch video in android app. I would like to add Next and Previous button for playing next or previous video after current video is ended. I googled it but to no avail. I need your help. Thanks in advance. 🙏🏾
If you're using the MediaPlayer class then maybe try adding logic to the callback for setOnCompletionListener(android.media.MediaPlayer.OnCompletionListener) that takes the user to the next video by getting what's next from the list and starting playback.
See Android Docs for more information. Without knowing what you're trying it's almost impossible to help you solve your problem. Please share the code from your solution related to your question.
I am using ExoPlayer to play my streams. I have implemented Picture in Picture which works pretty good but i haven't been able to implement play, pause controls on PiP window until now. I know that by defaul Exoplayer + Picture in Picture does not give us the Picture in Picture media controls we see in the Youtube player for instance.
Anyway i searched a lot about this issue, and found out a code that may help me but the problem is that the code is in Kotlin and i am using Java, as a beginner i wasn't able to find the alternative code for Java to make it work.
This is the recommendation i got:
val mediaSession = MediaSessionCompat(this, packageName)
val mediaSessionConnector = MediaSessionConnector(mediaSession)
mediaSessionConnector.setPlayer(player, null)
mediaSession.isActive = true
I know that i should implement it onStart() after handling Exoplayer. I thinked about converting my project in Kotlin but as a beginner i would like to focus in Java and instead find a way to fix this.
Android will show media controls in Picture-in-picture mode automatically if there is an active media session for the app.
https://developer.android.com/guide/topics/ui/picture-in-picture
Also, the code you posted belongs to the media session extension library for exoplayer, so you need to add it to your build.gradle
https://github.com/google/ExoPlayer/tree/release-v2/extensions/mediasession
I have recently started automating iOS apps on iPhone real devices with the XCUI test setup.
I got a scenario where my app contains 5 screens in the home page, each screen contains a unique card number and its balance so i have to fetch the card number from the screen and verify it with my input(expected) card number, if both are same then i have to click on the card screen otherwise if both are not same then i have to swipe right to the second screen and do the same process.
I was able to automate this scenrio in android perfectly because in android each screen is clearly differentiated with a unique card number but when i inspect the card number screen on iOS app it was showing all the list of cards attached to the app. in this case its getting difficult for me to get the card number from the app and verify it with my input card number . please see the below code which am already using it for android
String oysterCardVisibleNumberOnApp= data.get("PrestigeCardNumber");
while(!action.getText(HomePage.oysterCardNumber,"oysterCardNumber").equalsIgnorecase(oysterCardVisibleNumberOnApp))){
action.swipeRightToLeft();
}
it would be great if any one has any idea how to retrieve the list of elements/cards from the iOS app please let me know. or if you know any new methods in XCUI setup will help me to achieve this then please let me know. your help will be much appreciated :)
Please see the below Android Screen & iOS Screen pictures for getting more clarity
Android Screen
iOS Screen
Thank you
If you stop at a breakpoint for instance and you use:
po XCUIApplication().descendants(matching: .any)
in the debug console, you will get a list of all descendant elements from the main Application element. It will also give you a loose view of the structure.
You can then change .any to more specific element types e.g. .textField or .buttons.
You might be able to use the Accessibility Inspector in xcode for this:
https://developer.apple.com/library/content/documentation/Accessibility/Conceptual/AccessibilityMacOSX/OSXAXTestingApps.html
Based on areas you select in your app, it gives back detailed descriptions on each one. But what it brings back depends on the structure of your application. I was trying to do something similar in my own ios application and this helped me a bit.
You can use XCUIApplication().debugDescription to get a print out of the UI tree that XCUITest sees. You can also update the application code to set custom identifiers for your UI elements (these are only seen by XCUITest). for example card-1, etc.
I wonder how Google wrote its Media Player so that it could be always on top of any activity we open.
An easy guess would be, it is attaching the view to the Window. But, the way how it works with swipe and tap makes me think, if it is possible to do so with view attached to a window at all.
I Could not find any blogs or questions around. Thats why I am asking for some tips here. Thanks in advance.