2014-08-01 23:35:39 +00:00
|
|
|
-- Test script for property change notification mechanism.
|
2015-01-03 13:49:48 +00:00
|
|
|
-- Note that watching/reading some properties can be very expensive, or
|
|
|
|
-- require the player to synchronously wait on network (when playing
|
|
|
|
-- remote files), so you should in general only watch properties you
|
|
|
|
-- are interested in.
|
2014-08-01 23:35:39 +00:00
|
|
|
|
2014-11-28 22:18:50 +00:00
|
|
|
local utils = require("mp.utils")
|
2014-08-01 23:35:39 +00:00
|
|
|
|
|
|
|
for i,name in ipairs(mp.get_property_native("property-list")) do
|
|
|
|
mp.observe_property(name, "native", function(name, val)
|
|
|
|
print("property '" .. name .. "' changed to '" ..
|
2014-11-28 22:18:50 +00:00
|
|
|
utils.to_string(val) .. "'")
|
2014-08-01 23:35:39 +00:00
|
|
|
end)
|
|
|
|
end
|