Hi guys, I’m trying to use Fuse.StreamingPlayer library to create a simple music player. When I tap on one of 2 songs that I insert in the tracklist( one online and the other local) it doesn’t play. Someone can help me?
MainView:
<App>
<JavaScript>
let Observable = require("FuseJS/Observable");
let Player = require("FuseJS/StreamingPlayer");
let tracks = Observable();
Player.playlist = [
{
"id": 1,
"name": "Non sei PiewdiPie",
"artist": "QDSS",
"url": "https://yt3.ggpht.com/a-/AK162_6Gikpv8RPRpgt3Z6u2Ht87-v5Q6mfmb2EDiQ=s900-mo-c-c0xffffffff-rj-k-no",
"artworkUrl":"https://everyweeks.com/pZ2j56doGB6c0ykra8lXMj7nuNTDsT79-logo.png",
"duration": 139
},
{
"id": 2,
"name": "Sesso e Videogiochi",
"artist": "QDSS",
"url": "./sesso_videogiochi.mp3",
"artworkUrl":"https://everyweeks.com/pZ2j56doGB6c0ykra8lXMj7nuNTDsT79-logo.png",
"duration": 139
},
];
tracks.addAll( Player.playlist);
let stato = Observable("ciao sono lo stato");
Player.on("statusChanged", function(status) {
stato = JSON.stringify(status);
});
let is_play = false;
function play(){
Player.play();
}
function next(){
Player.next();
}
function previous(){
Player.previous();
}
function itemClicked(item){
console.log("Ho cliccato-->"+item["data"]["name"]);
Player.switchTrack(item["data"]);
}
module.exports = {
itemClicked:itemClicked,
tracks:tracks,
status:stato,
previous:previous,
play:play,
next:next
}
</JavaScript>
<ClientPanel>
<ScrollView>
<StackPanel>
<Each Items="{tracks}">
<DockPanel Padding="10" Margin="0,1" Background="#fff">
<Text Value="{name}" Clicked="{itemClicked}"/>
</DockPanel>
</Each>
</StackPanel>
</ScrollView>
<Panel Height="20%" Alignment="Bottom" Color="#2f198c" Padding="20">
<Button Alignment="Center" Clicked="{play}">
<Text Color="White">Play/Pausa</Text>
</Button>
<Button Alignment="CenterLeft">
<Text Color="White" Clicked="{play}" >Indietro</Text>
</Button>
<Button Alignment="CenterRight" Clicked="{next}">
<Text Color="White">Avanti</Text>
</Button>
</Panel>
</ClientPanel>
</App>
What does your .unoproj file look like? If there’s a local file in your project directory that you want to play in the app, you need to make sure it’s included in the app bundle (under "Includes"), like so: "mytrack.mp3:Bundle".
What does your .unoproj file look like? If there’s a local file in your project directory that you want to play in the app, you need to make sure it’s included in the app bundle (under "Includes"), like so: "mytrack.mp3:Bundle".
I have just included on "Includes" but it doesn’t work yet because i have the same problem with the online song.
It would help a lot if you actually got an error that we could work with.
If you have Android Studio installed, you could run the project with uno build -tandroid -d (which will open in AS), and then Run -> Debug from the menu there. If you enable breakpoints, you could see what happens in the native code.
If neither local nor remote files play as a result, the messages suggest that you have a problem with DRM on the files. Unfortunately I have no idea how to work around that, but I’m sure the internet might tell you something more about it.
You should check if this works with an MP3 that does not have any DRM on it.
If neither local nor remote files play as a result, the messages suggest that you have a problem with DRM on the files. Unfortunately I have no idea how to work around that, but I’m sure the internet might tell you something more about it.
You should check if this works with an MP3 that does not have any DRM on it.
DRM Control is a new feature of Android API level 26 but I don’t know where I heve to add DRM controls, whereas I don’t devlop Fuse.StreamingPlayer Library.
If that’s a feature that the StreamingPlayer library lacks, you can just go ahead and make a fork of the repository and implement the missing functionality.