Closed rastaman111 closed 2 years ago
Hi, have any thoughts on this issue?
@rastaman111 Thank you for your interest 🙋♀️
I'll be getting to it tomorrow. In the meantime, I have some questions to make it clearer.
@yoheimuta
The task is this: you need to save the last second of audio, that is, you left the application, saved it, listened for 10 seconds and switched to another track, saved it, etc., all this is saved in CoreData, and when I turn on audio and if this audio is in CoreData, comparison by name , then I start from the second that is indicated in CoreData. I think I clearly explained the task)
@rastaman111
In the musicPlayer.player method? .Rx.currentItemTime (), If I'm wrong, correct me and tell me how best to save seconds here
Using currentItemTime is a good way to implement this. I have no idea about any better solutions.
there is a problem with the fact that if there is a saved time for example 5 seconds and I am now at 9 seconds and pressed stop, then pressing start I start from 5 seconds
It seems to be better to remove a used item from the listItems to prevent from reusing the same one, although I presume that this part is not relevant to the library actually.
@yoheimuta The .Rx.currentItemTime () method is called about 10 times in 1 second, and so how can I stop all actions in the same way to save time in the first call?
@rastaman111 Your question means that you want to save the exact one per second? If so, I recommend that you filter all saved data by yourself like the below steps.
Hi @yoheimuta !
I want to do through SoreDate to do time saving In the musicPlayer.player method? .Rx.currentItemTime (), as I understand it, it is best to save data every 5 seconds var i = Int (($ 0.0? .seconds!)!)% 5
If I'm wrong, correct me and tell me how best to save seconds here
The second question is to start at a certain second i start in musicPlayer.player? .run (cmd: cmd)
But then there is a problem with the fact that if there is a saved time for example 5 seconds and I am now at 9 seconds and pressed stop, then pressing start I start from 5 seconds
If I'm wrong, correct me and tell me how best to start here
My code is not working correctly
I would be grateful for your help 👍