MediaListPlayer unexpectedly enters Ended state

This forum is about all development around libVLC.
TheChef1212
New Cone
New Cone
Posts: 2
Joined: 26 Jul 2019 03:48

MediaListPlayer unexpectedly enters Ended state

Postby TheChef1212 » 26 Jul 2019 03:56

Hello all,

I'm new to this project, and while I'm really excited for the possibilities, I've been having some troubles with some things. Namely, as I try to play a playlist full of songs, the MediaListPlayer will abruptly stop playing the next song after about a minute and 20 seconds. I've filled the first 50 slots of the playlist with the same very short audio file, and then let it go. Once it starts playing I continuously printed the MediaListPlayer's state in a While (True) loop. As it plays the song over and over, the State switches between Opening and Playing, as is expected, but after a short time the state becomes Ended and stays that way.

Any thoughts on how I can get this to stop happening?

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: MediaListPlayer unexpectedly enters Ended state

Postby mfkl » 26 Jul 2019 04:28

Share your full code, logs, wrapper used, platform, libvlc version, etc...
https://mfkl.github.io

TheChef1212
New Cone
New Cone
Posts: 2
Joined: 26 Jul 2019 03:48

Re: MediaListPlayer unexpectedly enters Ended state

Postby TheChef1212 » 02 Sep 2019 22:41

I can post my full code and platform, but I'm not really sure what the rest of that is to be honest.

Here is my full code:

Code: Select all

from gmusicapi import Mobileclient import vlc import time class MusicStreamer(): def load_radio(this): #Brandy song_list = this.api.get_station_tracks("a118f758-a015-34bb-a5ec-b880645f602e",25,this.do_not_play) #Come and get your love #song_list = this.api.get_station_tracks("be7299d0-a644-38bb-bd30-790d94f6e002",25,this.do_not_play) print("Loading Looping String") for _ in range(50): this.l.add_media(this.i.media_new(this.api.get_stream_url('f0477323-b624-32ea-acdb-463ca75d5f42'))) print("Loading Radio Sation") for song in song_list: print('Adding ' + song['title'] + " (" + song['artist'] + ")") try: this.plEnd = this.i.media_new(this.api.get_stream_url(song['storeId'])) this.l.add_media(this.plEnd) this.do_not_play.append(song['storeId']) except: this.plEnd = this.i.media_new(this.api.get_stream_url(song['id'])) this.l.add_media(this.plEnd) this.do_not_play.append(song['id']) def __init__(this): print("please wait") this.api = Mobileclient() #api.perform_oauth() #api.oauth_login('57770f1077ccad9f72afbfea95bbb1c393285a3777bd7b3e0a4d5e2f3031f6d6') this.api.oauth_login(Mobileclient.FROM_MAC_ADDRESS) this.do_not_play = [] this.i=vlc.Instance() this.l = this.i.media_list_new() this.load_radio() #print(this.l.count()) #print(this.l.item_at_index(0).get_mrl()) ''' for i in range(1,this.l.count()): print(this.l.item_at_index(i).get_mrl()[77:(77+19)]) ''' p=this.i.media_list_player_new() p.set_media_list(this.l) p.play() ''' print(this.plEnd.get_mrl()[77:(77+19)]) this.load_radio() print(this.plEnd.get_mrl()[77:(77+19)]) ''' #p.next() while (True): print(p.get_state()) while (True): cmd = input("Command:") if cmd == "play": p.play() elif cmd == "next": p.next() if (p.get_media_player().get_media().get_mrl() == this.plEnd.get_mrl()): print(True) this.load_radio() streamer = MusicStreamer()
I'm using the gmusic api to get mp3 files from Google Play Music and adding them to a vlc media list then trying to play all of them.

My code is far from done, but again, its entering the Ended state out of the blue so I need to fix that first.

I'm running Windows 10, but again I don't know where to find my version... not sure what the wrapper is or where any logs may be kept. I know I'm pretty naive about some of this, but I'd appreciate any help.

P.S. - I know its been a while, I'm just coming back to this project after basically giving up for a while.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 15 guests