def onPlay(self, event): media = pafy.new(self.url) gui = MediaGui(self.Parent, media.title, self.url) stream = media.getbest() gui.Show() self.Destroy() gui.player = Player(stream.url, gui.GetHandle())
def onPlay(self, event): # the event function called when the play youtube link is clicked linkDlg = LinkDlg(self) data = linkDlg.data # get the link and playing format from the dialog media = pafy.new(data["link"]) # creating a media object from the pafy module using the givven link gui = MediaGui(self, media.title, data["link"]) # initiating the media gui stream = media.getbest() if not data["audio"] else media.getbestaudio() # get the user requested playing stream, either audio or video self.Hide() gui.Show() gui.player = Player(stream.url, gui.GetHandle()) # adding the custom vlc media player object to the media gui
def onPlay(self, event): # the event function called when the play youtube link is clicked linkDlg = LinkDlg(self) data = linkDlg.data # get the link and playing format from the dialog url = data["link"] stream = get_video_stream(url) if not data["audio"] else get_audio_stream(url) gui = MediaGui(self, stream.title, data["link"]) # initiating the media gui self.Hide() gui.Show() gui.player = Player(stream.url, gui.GetHandle()) # adding the custom vlc media player object to the media gui
def playVideo(self): number = self.searchResults.Selection title = self.search.get_title(number) url = self.search.get_url(number) speak(_("جاري التشغيل")) media = pafy.new(url) gui = MediaGui(self, title, url, True if self.search.get_views(number) is not None else False) stream = media.getbest() self.Hide() gui.Show() gui.player = Player(stream.url, gui.GetHandle())
def playAudio(self): number = self.searchResults.Selection title = self.search.get_title(number) url = self.search.get_url(number) speak(_("جاري التشغيل")) media = pafy.new(url) gui = MediaGui(self, title, url) stream = media.getbestaudio() self.Hide() gui.Show() gui.player = Player(stream.url, gui.GetHandle())
def playAudio(self): number = self.searchResults.Selection if self.search.get_type(number) == "playlist": return title = self.search.get_title(number) url = self.search.get_url(number) speak(_("جاري التشغيل")) stream = get_audio_stream(url) gui = MediaGui(self, title, url, results=self.search, audio_mode=True) gui.Show() self.Hide() gui.player = Player(stream.url, gui.GetHandle())
def playVideo(self): number = self.searchResults.Selection if self.search.get_type(number) == "playlist": return title = self.search.get_title(number) url = self.search.get_url(number) speak(_("جاري التشغيل")) stream = get_video_stream(url) gui = MediaGui( self, title, url, True if self.search.get_views(number) is not None else False, results=self.search) gui.Show() self.Hide() gui.player = Player(stream.url, gui.GetHandle())
def onPlay(self, event): stream = get_video_stream(self.url) gui = MediaGui(self.Parent, stream.title, self.url) gui.Show() self.Destroy() gui.player = Player(stream.url, gui.GetHandle())