Board index   FAQ   Search  
  Login

PLEASE VISIT OUR NEW FORUMS FOR FUTURE POSTING. THIS FORUM REMAINS ONLINE FOR ARCHIVE PURPOSES ONLY.

Board index <dev>GENERAL</dev>

Movie Title OSD

This is or all devs of all types. For devs, by devs.

Movie Title OSD

Postby k_zeon » Sat Feb 25, 2012 2:21 pm

When playing a movie from my addon , i have noticed that if I bring up the info ie. the Timeline, name of movie, and settings etc , the name of the movie is displayed as one of my sources ie Putlocker.

When I create my menu i use the movie name to find the link, then when i click this i load up the sources.
then i click a source to play a movie.

Is there a way to set the correct movie title after i have selected a source
thanks
k_zeon
INVOLVED USER
 
Posts: 147
Joined: Wed Jan 25, 2012 9:10 am

Re: Movie Title OSD

Postby Eldorado » Sat Feb 25, 2012 3:27 pm

Are you setting your infolabels, specifically the title infolabel? I believe those determine what is displayed there
User avatar
Eldorado
DEV
 
Posts: 816
Joined: Wed Jan 04, 2012 12:15 pm

Re: Movie Title OSD

Postby k_zeon » Sat Feb 25, 2012 3:36 pm

Eldorado wrote:Are you setting your infolabels, specifically the title infolabel? I believe those determine what is displayed there


Hey Eldorado. yes i set the infolabel Title to the movie name when loading up TV SHows, i use your Metahandler to give show info etc.
Then when i select a show , i list seasons. I then pick a season and list episodes ie Season 1 Episode 1

Now when i select this link, i scrape the hosts details , ie Putlocker etc and add them to a menu

Now when i select putlocker and the movie plays, if i then show info while movie is playing i get the movie name as Putlocker.

here it the GetSource code for TV. I do pass in 'hostname' as Title so it is dsiaplayed so user can select it.

Code: Select all
elif mode == 'GetTVSource':
         
          tQual=''
          linkcount = 0
          html = net.http_GET(url).content
          reobj = re.compile(r'(?i)window.location.href = \'(.+?)\'.+?(?i)> &nbsp;(.+?)</a>', re.DOTALL | re.IGNORECASE)
          if reobj:
               for match in reobj.finditer(html):
                    url,name = match.groups()
                    url= GetHostSources('http://www.movie2k.to/' + url)
                    linkcount += 1
                    addon.add_video_item({'url': url} , {'title': str(linkcount) + '.' + name})

               addon.end_of_directory()
          else:

               # No link found only one embedded in page
               url= GetHostSources('http://www.movie2k.to/' + url)
               linkcount += 1
               addon.add_video_item({'url': url} , {'title': str(linkcount) + '.' + WebHostName(url)})
               addon.end_of_directory()
k_zeon
INVOLVED USER
 
Posts: 147
Joined: Wed Jan 25, 2012 9:10 am

Re: Movie Title OSD

Postby k_zeon » Sat Feb 25, 2012 3:37 pm

what i was thinking , is it possible that when i click a host ie putlocker i can set the title infolabel name just before i play the movie....
k_zeon
INVOLVED USER
 
Posts: 147
Joined: Wed Jan 25, 2012 9:10 am

Re: Movie Title OSD

Postby Bstrdsmkr » Sat Feb 25, 2012 4:26 pm

Create a listitem
Set the infolabels on that lisitem
Call xbmc.Player.Play(lisitem)

Check out the github source for 1Channel. I'm doing something similar, but I'm adding it to a Playlist, then calling play on the playlist
Bstrdsmkr
XBMC HUB TEAM
 
Posts: 1876
Joined: Mon Jan 16, 2012 10:30 pm

Re: Movie Title OSD

Postby k_zeon » Thu Mar 01, 2012 4:04 pm

Bstrdsmkr wrote:Create a listitem
Set the infolabels on that lisitem
Call xbmc.Player.Play(lisitem)

Check out the github source for 1Channel. I'm doing something similar, but I'm adding it to a Playlist, then calling play on the playlist



Hey Bstrdsmkr.

Having a little trouble with setting Title name.
At present i add_Videoitem with title as Putlocker and Url
then when i press play the code below gets called.

Code: Select all
if play:


     host = addon.queries.get('host', '')
     media_id = addon.queries.get('media_id', '')

     if url:
          stream_url = urlresolver.HostedMediaFile(url=url, host=host, media_id=media_id).resolve()
          addon.resolve_url(stream_url)
          addon.end_of_directory()
     else:
          dialog = xbmcgui.Dialog()
          dialog.ok('Error', 'Url Not available')


I have looked at your Playlist code and cannot get it to work at all.

I know i have to use

Code: Select all
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
listitem = xbmcgui.ListItem(title, iconImage=img, thumbnailImage=img)
playlist.add(url=stream_url, listitem=listitem)
xbmc.Player().play(playlist)
playlist.clear()


and have tried using it just after addon.resolve_url(stream_url)

any tips.
k_zeon
INVOLVED USER
 
Posts: 147
Joined: Wed Jan 25, 2012 9:10 am

Re: Movie Title OSD

Postby Bstrdsmkr » Thu Mar 01, 2012 4:35 pm

probably take out the addon.end_of_directory(), the rest looks like it should work. Also, move the playlist.clear() to just before the add if you want to add other stuff before playback
Bstrdsmkr
XBMC HUB TEAM
 
Posts: 1876
Joined: Mon Jan 16, 2012 10:30 pm

Re: Movie Title OSD

Postby k_zeon » Thu Mar 01, 2012 5:09 pm

Bstrdsmkr wrote:probably take out the addon.end_of_directory(), the rest looks like it should work. Also, move the playlist.clear() to just before the add if you want to add other stuff before playback


tried this but still cannot get it to play
Code: Select all
if play:

     
     host = addon.queries.get('host', '')
     media_id = addon.queries.get('media_id', '')
     MovieTitle = addon.queries.get('MovieTitle', '')

 if url:
          stream_url = urlresolver.HostedMediaFile(url=url, host=host, media_id=media_id).resolve()

          title = MovieTitle
          playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
          playlist.clear()
          listitem = xbmcgui.ListItem(label=title, iconImage='', thumbnailImage='', path=stream_url)
          listitem.setInfo('video', {'Title': title})
          playlist.add(url=stream_url, listitem=listitem)
          xbmc.Player().play(playlist)
         
         
          #xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=listitem) 

          #addon.resolve_url(stream_url)
          #addon.end_of_directory()
     else:
          dialog = xbmcgui.Dialog()
          dialog.ok('Error', 'Url Not available')
k_zeon
INVOLVED USER
 
Posts: 147
Joined: Wed Jan 25, 2012 9:10 am

Re: Movie Title OSD

Postby k_zeon » Thu Mar 01, 2012 5:57 pm

Dont worry, I figured it out.
k_zeon
INVOLVED USER
 
Posts: 147
Joined: Wed Jan 25, 2012 9:10 am

Re: Movie Title OSD

Postby k_zeon » Thu Mar 01, 2012 7:27 pm

Just a quick question.Once i have added the Resolved links to a playlist, do they play one after the other and also will there be a problem with playing the next url in playlist with wait times etc

ie on some hosts (free) you have to wait before you can play next file.

tks
k_zeon
INVOLVED USER
 
Posts: 147
Joined: Wed Jan 25, 2012 9:10 am

Next

Return to <dev>GENERAL</dev>



Who is online

Users browsing this forum: No registered users and 1 guest