Download
(21 Kb)
Download
Updated: 05/20/24 03:19 AM
Compatibility:
Gold Road (10.0.0)
Scions of Ithelia (9.3.0)
Updated:05/20/24 03:19 AM
Created:03/13/14 10:38 PM
Monthly downloads:70,883
Total downloads:2,761,981
Favorites:1,004
MD5:
Categories:Libraries, Game Controller
9.3.0
LibMediaProvider  Updated this week!  Popular! (More than 5000 hits)
Version: 1.0 r30
by: psypanda, ArtOfShred, Calamath, Seerah
LibMediaProvider is inspired by and borrows from LibSharedMedia-3.0, written for World of Warcraft.

This library facilitates the sharing of media (fonts, textures, etc) between addons. An addon can register media with LibMediaProvider, which then turns around and provides that media to any addon requesting media of that type.

LibMediaProvider is also available on GitHub.

Things To Know:
  • The "None" option for borders/backgrounds was removed, as ESO displays a white default texture if no file path is provided. Addons should handle hiding borders/backgrounds on their own through the alpha channel.
  • ESO currently does not support addon custom sounds to the game. Some sounds from the default UI have been provided as choices for your addons to use.
  • Label:SetFont("font") may be used with more than just a pre-defined font from the default UI. It may also take a string that is a combination of a file path, font size, and font style.
    Ex: label:SetFont("MyAddon/Font/path.slug|18|soft-shadow-thin")
  • There is currently only one statusbar texture in the game. If you wish to have access to more, they must be provided and registered by an addon.
  • Currently supported media types: background, border, font, statusbar, sound
API Documentation:

:Register(mediatype, key, data)
Registers a new handle of given type.
Arguments
mediatype
string - the type of the data, eg. font or statusbar
key
string - the handle to get the data from the lib
data
string - the data to associate with the handle; normaly a filename
Returns
boolean - false if data for the given mediatype-key pair already existes, true else
:Fetch(mediatype, key)
Fetches the data for the given handle and type.
Arguments
mediatype
string - the type of the data, eg. font or statusbar
key
string - the handle to get the data from the lib
Returns
string or nil - the data for the given handle or nil
:IsValid(mediatype [, key])
Checks if the given type (and handle) is valid.
Arguments
mediatype
string - the type of the data, eg. font or statusbar
[key]
string - the handle of the data
Returns
boolean - true if the type (and handle) is valid
:HashTable(mediatype)
Gets a hash table {data -> handle} to eg. iterate over.
Arguments
mediatype
string - the type of the data, eg. font or statusbar
Returns
table - hash table for the given type
:List(mediatype)
Gets a sorted list of handles.
Arguments
mediatype
string - the type of the data, eg. font or statusbar
Returns
table - list of handles for the given type
:GetDefault(mediatype)
Returns the default return value for nonexistant handles.
Arguments
mediatype
string - the type of the data, eg. font or statusbar
Returns
string or nil - default return value for nonexistant handles for the given type
:SetDefault(type, handle)
Sets a default return value for nonexistant handles. Won't replace an already set default.
Arguments
type
string - the type of the data, eg. font or statusbar
handle
string - the handle of the data
Returns
none
Callback:

LibMediaProvider_Registered
fires when a new handle was successfully registered
Argumentss
name
"LibSharedMedia_Registered"
mediatype
the type of the new handle
key
the name of the handle
Predefined Data:
Media from the default UI of the 5 main types is already pre-registered with the library.
1.0 r30 (Calamath)
- Addressed an unintended side-effects on vanilla font strings for lore books in western language modes due to the current natures of backup fonts.
- Updated API version to 101042 (ESO 10.0.x : Gold Road)

1.0 r29 (Calamath)
- Migration to the new UI font rendering system with Slug fonts.
- Restored the file structure and removed backward compatibility to Update 40.
- Adjusted predefined font definitions for the unofficial language mod add-ons, EsoBR, Cervanteso, EsoKR and EsoPL.
- Updated API version to 101041 (ESO 9.3.x : Update 41)

1.0 r28 (Calamath)
- Advance preparation for new text rendering system on PTS and guaranteed backward compatibility.

1.0 r27 (Calamath)
- Updated API version to 101040 (ESO 9.2.x : Update 40)

1.0 r26 (Calamath)
- Updated predefined fonts for EsoKR Ver.10.08 or later. (thanks Sharlikran)
- Added support for TurkishScrollsOnline add-on. (thanks Sharlikran)

1.0 r25 (Calamath)
- Updated API version to 101039 (ESO 9.1.x : Update 39)

1.0 r24 (Calamath)
- Fixed an issue where the MediaType table was not bypassed.

1.0 r23 (Calamath)
- Revamped the add-on framework for future extensions of the add-on API.
- Addressed a potential vulnerability issue where the internal media table could be overwritten by direct access.
- Excluded support for EsoZH add-on.
- Updated API version to 101038 (ESO 9.0.x : Necrom)

1.0 r22 (Calamath)
- Simplified Chinese language mode support.
- Temporarily excluded support for EsoZH.
- Added embedded Chinese fonts as predefined fonts.
- Some tweaks to backup font.
- Updated API version to 101036 (ESO 8.2.x : Firesong)

1.0 r21 (Calamath)
- Added embedded Japanese fonts as predefined fonts.
- Changed default font from Univers 55 to Univers 57
- Compatibility and support for unofficial language mod add-ons, EsoBR, Cervanteso, Italian Scrolls Online, EsoKR, Skrybowie Tamriel, EsoUA and EsoZH.
- Updated API version to 101035 (ESO 8.1.x : Lost Depths)

1.0 r20 (Calamath)
- Removed references and uses of LibStub completely.
- Updated API version to 101034 (ESO 8.0.x : High Isle)

1.0 r19 (Calamath)
- Updated API version to 101033 (ESO 7.3.x : Ascending Tide)

1.0 r18 (ArtOfShred)
- Updated API version for Blackwood.

1.0 r17 (ArtOfShred)
- Updated API version for Flames of Ambition.

1.0 r16 (ArtOfShred)
- Updated API version for Markarth.

1.0 r15 (ArtOfShred)
- Updated API version for Stonethorn.

1.0 r14 (ArtOfShred)
- Updated the font media table to properly support backup fonts for languages with missing glyphs not included in Western fonts, thanks to the efforts of Calamath!

1.0 r13 (ArtOfShred)
- LMP now functions without LibStub but supports loading in with LibStub for compatibility.
- LMP no longer includes an embedded LibStub. For older addons that may still require LibStub you will have to manually download it.

1.0 r12 (ArtOfShred)
- Embedded LibStub for dependency
- LMP wasn't working without LibStub so no longer creates an empty table if LibStub is not loaded

1.0 r11 (psypanda)
- Fix nested folders on zip creating (oopsie)

1.0 r10 (psypanda)
- LibMediaProvider works now with and w/o LibStub

1.0 r9 (psypanda)
- updated API version number to 100027
- added IsLibrary directive to manifest
- added global variable "LibMediaProvider" for direct access without using LibStub

1.0 r8 (Garkin)
- updated API Version number to 100011
- updated fonts for patch 1.6

1.0 r7 (Seerah)
- updated API Version number to 100010
- removed fonts that are no longer contained in the game files (they have been added to the MediaStash addon, however)
- changed default font from Arial Narrow (removed) to Univers 55

1.0 r6 (Seerah)
- preserve externally registered media types through library upgrades

1.0 r5 (Seerah)
- preserve externally registered media through library upgrades

1.0 r4 (Seerah)
- changed file path for solid textures to "" (since ESO treats an empty path as a solid color)
- updated LibStub.lua

1.0 r3 (Seerah)
- fixed bug where default handle was not returned if handle provided in :Fetch() was not found

1.0 r2 (Seerah)
- changed the default for backgrounds and borders since I removed the "none" option
Archived Files (29)
File Name
Version
Size
Uploader
Date
1.0 r29
21kB
Calamath
04/16/24 11:55 PM
1.0 r28 - beta
39kB
Calamath
01/29/24 01:29 PM
1.0 r27
21kB
Calamath
10/30/23 01:49 AM
1.0 r26
21kB
Calamath
07/30/23 09:16 AM
1.0 r25
21kB
Calamath
07/30/23 03:35 AM
1.0 r24
21kB
Calamath
05/20/23 11:39 PM
1.0 r23
21kB
Calamath
05/20/23 09:59 PM
1.0 r22
20kB
Calamath
11/06/22 09:56 PM
1.0 r21
20kB
Calamath
10/27/22 07:38 AM
1.0 r20
16kB
Calamath
06/08/22 12:28 PM
1.0 r19
16kB
Calamath
04/14/22 03:18 AM
1.0 r18
15kB
ArtOfShred
05/31/21 11:48 AM
1.0 r17
15kB
ArtOfShred
03/07/21 07:15 PM
1.0 r16
15kB
ArtOfShred
11/01/20 07:30 PM
1.0 r15
15kB
ArtOfShred
08/24/20 01:04 AM
1.0 r14
15kB
ArtOfShred
05/19/20 08:19 PM
1.0 r13
14kB
ArtOfShred
03/03/20 05:45 PM
1.0 r12
4kB
ArtOfShred
05/21/19 05:49 AM
1.0 r11
3kB
psypanda
05/20/19 01:30 AM
1.0 r10
3kB
psypanda
05/19/19 03:49 PM
1.0 r9
4kB
psypanda
05/02/19 03:58 PM
1.0 r8
4kB
Garkin
02/23/15 08:41 PM
1.0 r7
4kB
Seerah
11/06/14 11:13 PM
1.0 r6
4kB
Seerah
07/20/14 08:02 PM
1.0 r5
4kB
Seerah
07/17/14 08:49 PM
1.0 r4
4kB
Seerah
07/13/14 09:26 PM
1.0 r3
4kB
Seerah
03/15/14 01:29 PM
1.0 r2
4kB
Seerah
03/14/14 07:26 PM
1.0 r1
4kB
Seerah
03/13/14 10:38 PM


Post A Reply Comment Options
Unread 04/13/22, 08:50 PM  
Calamath
AddOn Author - Click to view AddOns

Forum posts: 37
File comments: 228
Uploads: 7
Release note:

Announcement:
I have taken over the maintenance of the LibMediaProvider add-on and the GitHub repository from ArtOfShred.
We appreciate his contribution over the years.
I will start providing live updates from now on.

[Update41:]
If you are experiencing a situation where the game freezes when displaying CJK Fonts,
we recommend temporarily turning OFF multi-threaded rendering in the graphic settings.
This is a vanilla UI issue.


- Calamath

Planned changes:
  • Nothing particularly.

Recent changes:
  • Migration to the new UI font rendering system to be introduced in Update 41. [V1.0 r29]
  • Complete removal of LibStub library. [V1.0 r20]
  • Change default font media to 'Univers 57'. [V1.0 r21]
  • Media table security. [V1.0 r23]
    - Cases of other add-ons directly rewriting and breaking the media table of this add-on.
    Make it impossible to do these things.
    Lua Code:
    1. local LMP = LibMediaProvider
    2. LMP.MediaTable.font["Univers 57"] = nil
  • Unofficial Language Add-on Support. [V1.0 r21]
    - Instead, create a dedicated media table for unofficial language modes.
    Thus, authors of some unofficial language add-ons may need to let me know the exact full pathname of the font.
    In that case, please write it together with the two letters that represent the language mode.


Instructions for add-on authors:

[COMPATIBILITY-BREAKING CHANGE]
As of version 1.0 r20, LibStub is no longer used.
Instead, please use the global variable LibMediaProvider for direct access to the library.

Therefore, it is necessary to rewrite as follows.

Lua Code:
  1. -- YOUR OLD ADD-ON CODE
  2. -- before
  3. local LMP = LibStub:GetLibrary("LibMediaProvider-1.0")
  4.  
  5. -- after
  6. local LMP = LibMediaProvider
Last edited by Calamath : 04/17/24 at 12:02 AM.
Report comment to moderator  
Reply With Quote
Unread 04/18/24, 09:52 PM  
StarkeRealm

Forum posts: 0
File comments: 44
Uploads: 0
Originally Posted by Calamath
Originally Posted by StarkeRealm
Okay, so I manually rolled it back to R28.

I'm running the game in English.

Specifically, S'Rendarr, Auto Categories Revised, and Inventory Insight stopped working on the update to R29. Auto Categories was absent from the addons setting menu, with R29. (I'm not 100% sure if S'Rendarr was gone or not, but the UI elements were no longer displayed on the HUD.)

Inventory Insight's hotkey would still bring up the inventory window, but no data was visible.
Thanks for the info, StarkeRealm.
It is important for me you are using the language mode 'en'.
In conclusion, I think it is not a LibMediaProvider issue.

Except for a few unofficial language modes, there are no actual changes between r28 and r29.
The only difference is the version number.

So, the provided information is that you are using several add-ons that have dependencies on both LibAddonMenu and LibMediaProvider.
And it is possible that some of them have a bug that requires the LibMediaProvider version must be 28.

I don't know if my prediction is correct.
But that's all I can help you with on this issue.

- Calamath
I appreciate that. For the moment, I'm not having any issues.

I have a suspicion that this was an error with Minion. I suspect that Minion either failed to overwrite a file correctly, or failed to remove some other file.

Now, I think I can rule out LibAddonMenu, based on the updates that executed simultaneously. Auto Category, Character Knowledge, Craft Store, Endeavor Tracker, Event Tracker, Item Browser, LibCharacterKnowledge, and LibMediaProvider updated. So, one of those updates caused the issue. At that point, especially if this isn't happening to anyone else (which seems to be the case), then I suspect the remaining culprit is Minion itself. Especially since the "fix" I kludged in worked off manually emptying the Library's directory, and then copying the contents from a download (without alerting Minion.)

For the record, my first reaction was that I'd somehow corrupted the userdata for AutoCat. I've done that in the past with improperly formatted rules (read: typos), and was thinking one of my more "creative" queries caused the addon to brick itself. It wasn't until I started tinkering that I realized some other addons were offline as well.

I do apologize for reacting so quickly to what's probably a false positive due to Minion being weird. I'll keep doing some testing over here, and if I do run into problems again, I'll let you know what I find, and if I can identify how to cause them.
Report comment to moderator  
Reply With Quote
Unread 04/18/24, 08:36 PM  
Calamath
AddOn Author - Click to view AddOns

Forum posts: 37
File comments: 228
Uploads: 7
Originally Posted by StarkeRealm
Okay, so I manually rolled it back to R28.

I'm running the game in English.

Specifically, S'Rendarr, Auto Categories Revised, and Inventory Insight stopped working on the update to R29. Auto Categories was absent from the addons setting menu, with R29. (I'm not 100% sure if S'Rendarr was gone or not, but the UI elements were no longer displayed on the HUD.)

Inventory Insight's hotkey would still bring up the inventory window, but no data was visible.
Thanks for the info, StarkeRealm.
It is important for me you are using the language mode 'en'.
In conclusion, I think it is not a LibMediaProvider issue.

Except for a few unofficial language modes, there are no actual changes between r28 and r29.
The only difference is the version number.

So, the provided information is that you are using several add-ons that have dependencies on both LibAddonMenu and LibMediaProvider.
And it is possible that some of them have a bug that requires the LibMediaProvider version must be 28.

I don't know if my prediction is correct.
But that's all I can help you with on this issue.

- Calamath
Last edited by Calamath : 04/18/24 at 08:37 PM.
Report comment to moderator  
Reply With Quote
Unread 04/18/24, 03:41 PM  
StarkeRealm

Forum posts: 0
File comments: 44
Uploads: 0
Originally Posted by Calamath
Originally Posted by StarkeRealm
R29 appears to break all dependent mods to varying degrees. Some error out of the menu entirely, while others technically work, but return no data.
If you want me to spend more time on this issue, at least tell me which language mode you are using. en or de or ru or ... ?
You also need to detail which features of this library you are having problems with.
Okay, so I manually rolled it back to R28.

I'm running the game in English.

Specifically, S'Rendarr, Auto Categories Revised, and Inventory Insight stopped working on the update to R29. Auto Categories was absent from the addons setting menu, with R29. (I'm not 100% sure if S'Rendarr was gone or not, but the UI elements were no longer displayed on the HUD.)

Inventory Insight's hotkey would still bring up the inventory window, but no data was visible.
Report comment to moderator  
Reply With Quote
Unread 04/18/24, 12:40 AM  
Calamath
AddOn Author - Click to view AddOns

Forum posts: 37
File comments: 228
Uploads: 7
Originally Posted by StarkeRealm
R29 appears to break all dependent mods to varying degrees. Some error out of the menu entirely, while others technically work, but return no data.
If you want me to spend more time on this issue, at least tell me which language mode you are using. en or de or ru or ... ?
You also need to detail which features of this library you are having problems with.
Last edited by Calamath : 04/18/24 at 12:44 AM.
Report comment to moderator  
Reply With Quote
Unread 04/17/24, 11:56 PM  
StarkeRealm

Forum posts: 0
File comments: 44
Uploads: 0
R29 appears to break all dependent mods to varying degrees. Some error out of the menu entirely, while others technically work, but return no data.
Report comment to moderator  
Reply With Quote
Unread 03/13/24, 03:18 AM  
Calamath
AddOn Author - Click to view AddOns

Forum posts: 37
File comments: 228
Uploads: 7
Notice of postponement of r29 update.

As you know, we have moved to the new UI font rendering system with Update 41.

The LibMediaProvider add-on does not provide slug font files, but I believe the recently released r28 will continue to work reliably.
As for r29, I will wait for the unofficial language add-ons to support Update 41.

- Calamath
Last edited by Calamath : 03/13/24 at 09:29 PM.
Report comment to moderator  
Reply With Quote
Unread 03/11/24, 11:16 PM  
jebbrown

Forum posts: 0
File comments: 15
Uploads: 0
inventory insight broken

I just redownloaded both inventory insight and the newest libmedia provider and it is working fine now. I have no Idea what I did wrong, but it is working well now, so thanks to everyone who contributed to this wonderful addon.

--------------

This did not happen on my machine, and Inventory Insight ceased to function now that update 41 is out . I just wanna cry - can't function without inventory insight

This was updated by Minion, I hope it did properly delete old folder and extracted new files (did not check your zip file ), else forgive me!

Edit: Just in case, checked the zip file:
[/quote]

Hi Baertram.
I figured you would notice, but they are intentionally left in.
r28.x is a beta version and the add-on configuration is temporary.
Redundancy, as clunky as it is, but save me from time to time.

On the day Update 41 is published, the contents of the 101041 folder will overwrite the parent directory and subfolders will be deleted. [/quote]
Last edited by jebbrown : 03/12/24 at 03:51 AM.
Report comment to moderator  
Reply With Quote
Unread 01/31/24, 12:19 AM  
Calamath
AddOn Author - Click to view AddOns

Forum posts: 37
File comments: 228
Uploads: 7
Originally Posted by Baertram
Hey Calamath,

your API 101040 (current live) and API101041 zip file also contaisn old files still in the main folder which never get used anymore, right?


ttx file at least does not load them anymore:
Code:
$(APIVersion)/fontstrings_shared.xml
$(APIVersion)/backupfont_$(language).xml
$(APIVersion)/LibMediaProvider-1.0.lua
This was updated by Minion, I hope it did properly delete old folder and extracted new files (did not check your zip file ), else forgive me!

Edit: Just in case, checked the zip file:
Hi Baertram.
I figured you would notice, but they are intentionally left in.
r28.x is a beta version and the add-on configuration is temporary.
Redundancy, as clunky as it is, but save me from time to time.

On the day Update 41 is published, the contents of the 101041 folder will overwrite the parent directory and subfolders will be deleted.
Last edited by Calamath : 01/31/24 at 01:09 AM.
Report comment to moderator  
Reply With Quote
Unread 01/30/24, 01:59 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 5011
File comments: 6067
Uploads: 78
Hey Calamath,

your API 101040 (current live) and API101041 zip file also contaisn old files still in the main folder which never get used anymore, right?


ttx file at least does not load them anymore:
Code:
$(APIVersion)/fontstrings_shared.xml
$(APIVersion)/backupfont_$(language).xml
$(APIVersion)/LibMediaProvider-1.0.lua
This was updated by Minion, I hope it did properly delete old folder and extracted new files (did not check your zip file ), else forgive me!

Edit: Just in case, checked the zip file:
Last edited by Baertram : 01/30/24 at 02:01 PM.
Report comment to moderator  
Reply With Quote
Unread 05/21/23, 01:55 AM  
ApoAlaia

Forum posts: 6
File comments: 145
Uploads: 0
Originally Posted by Calamath
Originally Posted by ApoAlaia
Good morning beautiful people.

Just a quick heads up, after installing the latest version (r23) both LUI Extended and Master Merchant threw errors and failed to initialise.

It might be that those addons need updates to accommodate the changes, not really sure (although hoping that's not the case because LUI Extended is no longer being actively developed or maintained).

I have reverted to r22 for now.
Thanks for the report, fixed in r24. Hope it works. ;-)
It does \o/

Well that was a quick turnaround, thank you!

Bonus relief that we can carry on using LUI Extended. Phew.
Report comment to moderator  
Reply With Quote
Unread 05/20/23, 11:41 PM  
Calamath
AddOn Author - Click to view AddOns

Forum posts: 37
File comments: 228
Uploads: 7
Originally Posted by ApoAlaia
Good morning beautiful people.

Just a quick heads up, after installing the latest version (r23) both LUI Extended and Master Merchant threw errors and failed to initialise.

It might be that those addons need updates to accommodate the changes, not really sure (although hoping that's not the case because LUI Extended is no longer being actively developed or maintained).

I have reverted to r22 for now.
Thanks for the report, fixed in r24. Hope it works. ;-)
Report comment to moderator  
Reply With Quote
Unread 05/20/23, 11:27 PM  
Calamath
AddOn Author - Click to view AddOns

Forum posts: 37
File comments: 228
Uploads: 7
Re: Latest update API changes stop LUI from loading successfully

Originally Posted by immediacy
Hello,

I updated LMP and noticed it caused LUI to crash fatally on load. I've traced it to this line, and wondered if anyone had a proposed hotfix in the new LMP API for how to correct this code.

Code:
for _, f in pairs(LMP:List(LMP.MediaType.FONT)) do
        if not LUIE.Fonts[f] then
            LUIE.Fonts[f] = LMP:Fetch(LMP.MediaType.FONT, f)
        end
    end
Thanks for the report, fixed in r24. Hope it works. ;-)
Last edited by Calamath : 05/20/23 at 11:47 PM.
Report comment to moderator  
Reply With Quote
Unread 05/20/23, 10:40 PM  
immediacy

Forum posts: 0
File comments: 3
Uploads: 0
Latest update API changes stop LUI from loading successfully

Hello,

I updated LMP and noticed it caused LUI to crash fatally on load. I've traced it to this line, and wondered if anyone had a proposed hotfix in the new LMP API for how to correct this code.

Code:
for _, f in pairs(LMP:List(LMP.MediaType.FONT)) do
        if not LUIE.Fonts[f] then
            LUIE.Fonts[f] = LMP:Fetch(LMP.MediaType.FONT, f)
        end
    end
Report comment to moderator  
Reply With Quote
Unread 05/20/23, 10:37 PM  
ApoAlaia

Forum posts: 6
File comments: 145
Uploads: 0
Good morning beautiful people.

Just a quick heads up, after installing the latest version (r23) both LUI Extended and Master Merchant threw errors and failed to initialise.

It might be that those addons need updates to accommodate the changes, not really sure (although hoping that's not the case because LUI Extended is no longer being actively developed or maintained).

I have reverted to r22 for now.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: