How to pass the MediaLibrary to the AudioService and start playing from specific song in flutter - just-audio

I have all the UI and logic to read songs from the device and I made my own loagic for playlists because android 10 has a bug. Anyways, so I'm looking on the audio_service package. The example has it all, but the Media library is hardcoded. Despite the name I can imagine this as Playlist with a list of songs.
How can I pass the playlist chosen to play. Maybe Shared preferences?
And another question: Is there a way from which song to start playing the playlist?

Related

Star a song in spotify from an external source?

I'm looking for a way to star a song in Spotify without having to go to the app itself.
For instance:
I'm playing a game on fullscreen, or I'm working on something and Spotify is on for music. I hear a great song and I want to star it.
Now instead of going to the app, I want to star the song using a shortcut or a dedicated external button.
Whether it is a shortcut, a USB button, or a button on a remote, I believe this function would be really helpful. I've searched through the Spotify core API, but I couldn't find anything that enables me to "star" a song.
Any ideas?
Since you tagged CocoaLibSpotify in this question, well, CocoaLibSpotify has this functionality built right in - the SPTrack object has the starred property. It'd be fairly simple to write a little app that, when triggered, fetches the currently playing track using the Spotify client's AppleScript bridge and use CocoaLibSpotify to star it.
Alternatively, the Apps API can star a track as well (the Track object has the starred property). You could use the player object to get the current track and star it. However, linking that to an external button will be tricky. One (hacky) way would be to have the button trigger a system URL launch of spotify:app:star-this-track:invocation:1 where the number at the end increments each time you push the button. Then, the application's ARGUMENTSCHANGED event will fire, at which point you can star the track.

Finding video content in iPhone playlist

Running iOS 4.2.1 I'm able to create a mixed playlist containing both audio and video. 3 items, first a video then 2 audio tracks. I know I'm working with the correct playlist.
However, cycling through the items like this...
for (MPMediaItem *mediaItem in [playlist items]) {
NSLog(#"%#",mediaItem);
NSLog(#"path %#",[mediaItem valueForProperty:MPMediaItemPropertyAssetURL]);
}
...returns me output of...
<MPConcreteMediaItem: 0x1303d0> 9016712715169871401
path ipod-library://item/item.mp3?id=9016712715169871401
<MPConcreteMediaItem: 0x12e9e0> 9016712715169871401
path ipod-library://item/item.mp3?id=9016712715169871401
...so my video asset is being excluded from the playlist. The iPhone plays the playlist correctly when I'm using it as an iPod.
I've gotten as far as I have using Ole Begemann's sample code from here. Does anyone know if video assets are supposed to be excluded? Is there another approach which would combine audio and video assets, assuming they're mixed in a playlist which I know the name of?

Creating a image browser Boxee App

I am writing a Boxee App and I want to list all albums for a picasa account.
The problem I'm facing is that I have no idea of how to list albums and photos in the Boxee app.
The application itself should be fairly simple:
First a main screen where all your albums are listed, then when you click an album you see all your photos in a grid of say 4x5 photos
When you click a photo you go in to a view where one photo is displayed on the whole screen where back and forward lets users go back and forth in that gallery.
I have wrote a simple wrapper arround the gdata photos Python API which I was aiming to use so hopefully all the heavy lifting will be done by the gdata API.
Does anybody have some good links to example applications or tutorials to one or more of the features I want in the application?
Boxee uses an XML based approach for describing an application's interface. You'll need one XML for each screen of your application and you'll connect them together using the API.
You would build this XML screens using various controls defined by the XML API. Basically a control (a button, a list, a label, etc) is described as an XML node with attributes and child nodes. You can check a list of all the available controls here: http://developer.boxee.tv/UI_Controls
You can use the Python API to control various properties of the UI elements you coded in your XML files. For example you could fill a list with photos taken from a server, you could change the label on a button, load another screen and much more. Here are the Python API specs: http://developer.boxee.tv/Python_API
Make sure you read trough the Boxee dev pages and also remember that Boxee originated from the XBMC project so most of the documentation regarding XBMC skinning (http://wiki.xbmc.org/?title=Skinning_XBMC) also applies to Boxee.
Another thing that might help you is looking at other apps. Find an app that is somehow similar to what you want to do, find it in Boxee's app folder and peek at the code there.

Getting list/path of songs from iphone's library

Want to create an alarm application, that will play a music file at a specific time. How can i get list of songs from iphone's library. I want to show this list in tableview, user can then select a single file that will be played at sepecified time.
Any code sample?
Just use the MPMediaPickerController.
The sample code AddMusic shows how to choose (and add) music in the iPod library.

How do I add a song to itunes using Applescript and make a vote for it?

Since iTunes 8.1 has iTunes DJ I want to be able to upload songs from one of my computers to another that runs iTunes 8.1, and add these to the Library on iTunes. After that, I want to make that song the next song in iTunes, but only if no other song has been "requested" more times through the Apple Remote application.
Doug's AppleScripts for iTunes has a script called Play Album Next In Party Shuffle. It seems like a good jumping-off point. iTunes DJ and Party Shuffle are apparently the same thing as far as scripts are concerned.