Kodi Community Forum

Full Version: [RELEASE] Play Locally - Cache videos locally before playing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone, this is my first addon to solve a specific WAF problem I was facing where I would get regular buffering due to only having access to wifi.

Frodo 12.2 - http://windebank.com.au/script.playLocally-1.0.0.zip

What it does

Adds a context menu item to both Movies and TV Episodes to allow a user to cache the file locally before playing. The file is coped to the local device and then plays immediately and the local file is removed once playback ends, either when the file finishes or when the user stops playback.


- Config to allow users to select cache directory (defaulted to system agnostic special://temp)
- Displays progress bar whilst file is copying
- Local file automatically removed once playback completes
- Certain media tags are loaded before playing for display in pause menu (currently title, year, tagline and plot)
- Context menu item only displays if script is enabled
- File copy buffer exposed in addon configuration for testing of optimal setting (changing this didn't make a noticeable difference on my laptop)

To install

See README.txt or below.

To use this script you will need to add a context menu control directly by editing the skin xml files.

Tested with Aeon MQ5

Add the following to DialogContextMenu.xml (\XBMC\addons\skin.aeonmq5\720p) where you want the button to be in the context menu:

<control type="button" id="1034">






    <visible>System.HasAddon(script.playLocally) + [Container.Content(episodes) | Container.Content(movies)]</visible>


Add the following to the skin's language file (\XBMC\addons\skin.aeonmq5\language\English\strings.po):

msgctxt "#88888"

msgctxt "#88889"
msgid "Path to cache local media"
msgstr "Path to cache local media"

msgctxt "#88890"
msgid "Buffer size"
msgstr "Buffer size"

** NOTE - One minor bug with settings.xml being unable to read setting descriptions from strings.po so hard coded in English until resolved.






If anyone has any issues or requests, please post here. I've only tested on two instances of XBMC - Frodo 12.2 on Openelec and Frodo 12.2 on Windows 8.

Just found one small bug where it clashes with the TVTunes script and captures the xbmc.Player.onPlaybackEnded() event prematurely.

Will update a minor patch in a couple of hours.
I was looking for something like that to enable my hdd to spin down during playback.
My HTPC is completely noiseless, and the loud hdd is driving me crazy.
Will give it a look in the new year, and contact you when I find bugs.

A very usefull extension I could imagine for this:
Give the user a custom code field that gets executed when the movie is finished with caching.
I could enter the spindown command there, so it doesn't wait for the hdd to "timeout".

Happy new year and thanks a lot Smile

BTW: For Aeon Nox 4.1.9 the context menu is in [your home folder path]/.xbmc/addons/Aeon-Nox/1080i/DialogContextMenu.xml
and then enter

<control type="button" id="1034">
                <visible>System.HasAddon(script.playLocally) + [Container.Content(episodes) | Container.Content(movies)]</visible>

to make it appear in the context menu. (I needed to adjust it a little bit, the code above doesn't work with Nox)

The Language file is equivalent.