History

player: remove shared-script-properties property

This property was never encouraged. The manual even stated that "You should avoid using it, unless you absolutely have to." Since we now have user-data which is superior in every single way and replaces this, delete this property. The manual also has threatened people for years with the line "It's a makeshift solution which could go away any time (for example, when a better solution becomes available)." We were nice and deprecated it in 1d00aee8e191c9689a20e67e3d6dfd2af6ad2588 for a while to give script authors some time to update. Let's remove it for good now.

Dudemanguy committed 3 years ago

Commit 86b498e1 parent 52207255 files · +2 −98Browse files

Showing the changes to player/javascript (1 of 5 files). Show all

Unified · Split

player/javascript/defaults.js+0−22
@@ -177,28 +177,6 @@ mp.abort_async_command = function abort_async_command(id) { · 176 unmodified lines
177 mp._abort_async_command(id);177 mp._abort_async_command(id);
178}178}
179 179
180// shared-script-properties - always an object, even if without properties
181function shared_script_property_set(name, val) {
182 if (arguments.length > 1)
183 return mp.commandv("change-list", "shared-script-properties", "append", "" + name + "=" + val);
184 else
185 return mp.commandv("change-list", "shared-script-properties", "remove", name);
186}
187
188function shared_script_property_get(name) {
189 return mp.get_property_native("shared-script-properties")[name];
190}
191
192function shared_script_property_observe(name, cb) {
193 return mp.observe_property("shared-script-properties", "native",
194 function shared_props_cb(_name, val) { cb(name, val[name]) }
195 );
196}
197
198mp.utils.shared_script_property_set = shared_script_property_set;
199mp.utils.shared_script_property_get = shared_script_property_get;
200mp.utils.shared_script_property_observe = shared_script_property_observe;
201
202// osd-ass180// osd-ass
203var next_assid = 1;181var next_assid = 1;
204mp.create_osd_overlay = function create_osd_overlay(format) {182mp.create_osd_overlay = function create_osd_overlay(format) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t