Play local videofiles instead of urls
#1
My Code:

# Create a playable item with a path to play.
play_item = xbmcgui.ListItem(path=path)

# Pass the item to the Kodi player.
xbmcplugin.setResolvedUrl(_handle, True, listitem=play_item)

here the path is a local path ,I tryed with special://, plugin://, file:// ...
But it's not working.
How can i solve the problem?
Reply
#2
Have you considered just using the path to the file?
Reply
#3
The only trip up that I can think of is that you can't use UNC paths. you need to rewrite it as smb://server/path/to/file. Otherwise just give it the path, whether /linux/path/to/file or C:\\path\\to\\file
Developer for Shoko and Nakamori. Long time user of Kodi, before it was even called Kodi. My XBOX died long ago, but Windows is still just as broken and necessary. I obviously watch anime, given my first comment. Video games, manga, music, you name it.
Reply
#4
(2019-04-07, 22:24)da3dsoul Wrote: The only trip up that I can think of is that you can't use UNC paths. you need to rewrite it as smb://server/path/to/file. Otherwise just give it the path, whether /linux/path/to/file or C:\\path\\to\\file

I don't think you can just rewrite it as an smb path.  As far as I know there are two choices for for dealing with files in python:

1- Use native python file calls.  If you do that you can do local files and remote shares that are mounted natively by the local file system.  If you do remote shares any other way then you have to have all the needed python libraries to do remote shares (smb, nfs, etc).

2- Use xbmcvfs (vitual file system).  With that anything you can browse to in Kodi you can access via python.  The one trick there is that the addon probably needs a setting to define a "root" path so that all your path calls are joins with that root path.  This lets you use SMB or NFS shares natively in Kodi.

I hope that made some sense.  If it didn't, I can try again.  '-)
Reply
#5
Normally, that would be a fair response. I'm saying this because I'm an add-on developer, and I've done this, and it worked. Rewriting it to smb:// only works if you have no password or it's "remembered" by the OS.
Developer for Shoko and Nakamori. Long time user of Kodi, before it was even called Kodi. My XBOX died long ago, but Windows is still just as broken and necessary. I obviously watch anime, given my first comment. Video games, manga, music, you name it.
Reply

Logout Mark Read Team Forum Stats Members Help
Play local videofiles instead of urls0