Просмотр редакций: Задача №1560

Тема 0001560: Lua: position thumbs
Редакция 2020-05-04 13:44 от SergeyVS
Описание add handler
  local handlerInfo={}
  handlerInfo.luaFunction = 'eventfunction'
  handlerInfo.regexString = 'regex string' --optional,by default empty
  handlerInfo.minImageWidth = 100 --optional,by default 200
 handlerInfo.minImageHeight = 200 --optional,by default 100
 handlerInfo.sizeFactor = 0.18 --optional,by default 0.2
 handlerInfo.backColor = ARGB(200,0,0,0) --optional,by default ARGB(255,0,0,0)
 handlerInfo.glowParams = 'glow="7" samples="5" extent="4" color="0xB0000000" ' --optional,by default empty
 --handlerInfo.textColor = ARGB(255,255,255,255) --optional,by default ARGB(255,255,255,255)
 --handlerInfo.marginLeft = 5
 --handlerInfo.marginRight = 5
 --handlerInfo.marginTop = 5
 --handlerInfo.marginBottom = 5
 --handlerInfo.clearImgCacheOnStop = false
--handlerInfo.showPreviewWhileSeek = true --from b12.5
        
  handler = m_simpleTV.PositionThumbs.AddHandler(handlerInfo)
 
event function

function eventfunction(queryType,address,forTime)
 
 if queryType == 'testAddress' then
  --never called because we setted handlerInfo.regexString and testing address for this handler in core
  return false
 end
 
 if queryType == 'getThumbs' then
  --no need test address, we setted handlerInfo.regexString and testing address for this handler in core

  local t ={}
  t.playAddress = address
  
  --t.rawData -- for direct loading data of image, if setted then t.url, t.httpParams will be ignored
  t.url = url
  t.httpParams = {}
  --t.httpParams.userAgent
  --t.httpParams.proxy
  --t.httpParams.method
  --t.httpParams.body
  t.httpParams.extHeader = 'referer:' .. address
  
  t.elementWidth = elementWitdh
  t.elementHeight = elementHeight
  t.startTime = index * imgLen
  t.length = imgLen
  t.elementsPerImage -- optional, by default 0 (auto)
 
  m_simpleTV.PositionThumbs.AppendThumb(t)
  
  return true
 end
 
end
----------------------------------------------------------------------------------



Редакция 2020-01-06 12:01 от SergeyVS
Описание add handler
  local handlerInfo={}
  handlerInfo.luaFunction = 'eventfunction'
  handlerInfo.regexString = 'regex string' --optional,by default empty
  handlerInfo.minImageWidth = 100 --optional,by default 200
 handlerInfo.minImageHeight = 200 --optional,by default 100
 handlerInfo.sizeFactor = 0.18 --optional,by default 0.2
 handlerInfo.backColor = ARGB(200,0,0,0) --optional,by default ARGB(255,0,0,0)
 handlerInfo.glowParams = 'glow="7" samples="5" extent="4" color="0xB0000000" ' --optional,by default empty
 --handlerInfo.textColor = ARGB(255,255,255,255) --optional,by default ARGB(255,255,255,255)
 --handlerInfo.marginLeft = 5
 --handlerInfo.marginRight = 5
 --handlerInfo.marginTop = 5
 --handlerInfo.marginBottom = 5
 --handlerInfo.clearImgCacheOnStop = false
        
  handler = m_simpleTV.PositionThumbs.AddHandler(handlerInfo)
 
event function

function eventfunction(queryType,address,forTime)
 
 if queryType == 'testAddress' then
  --never called because we setted handlerInfo.regexString and testing address for this handler in core
  return false
 end
 
 if queryType == 'getThumbs' then
  --no need test address, we setted handlerInfo.regexString and testing address for this handler in core

  local t ={}
  t.playAddress = address
  
  --t.rawData -- for direct loading data of image, if setted then t.url, t.httpParams will be ignored
  t.url = url
  t.httpParams = {}
  --t.httpParams.userAgent
  --t.httpParams.proxy
  --t.httpParams.method
  --t.httpParams.body
  t.httpParams.extHeader = 'referer:' .. address
  
  t.elementWidth = elementWitdh
  t.elementHeight = elementHeight
  t.startTime = index * imgLen
  t.length = imgLen
  t.elementsPerImage -- optional, by default 0 (auto)
 
  m_simpleTV.PositionThumbs.AppendThumb(t)
  
  return true
 end
 
end
----------------------------------------------------------------------------------



Редакция 2020-01-02 15:12 от SergeyVS
Описание add handler
  local handlerInfo={}
  handlerInfo.luaFunction = 'eventfunction'
  handlerInfo.regexString = 'regex string' --optional,by default empty
  handlerInfo.minImageWidth = 100 --optional,by default 200
 handlerInfo.minImageHeight = 200 --optional,by default 100
 handlerInfo.sizeFactor = 0.18 --optional,by default 0.2
 handlerInfo.backColor = ARGB(200,0,0,0) --optional,by default ARGB(255,0,0,0)
 handlerInfo.glowParams = 'glow="7" samples="5" extent="4" color="0xB0000000" ' --optional,by default empty
 --handlerInfo.textColor = ARGB(255,255,255,255) --optional,by default ARGB(255,255,255,255)
 --handlerInfo.marginLeft = 5
 --handlerInfo.marginRight = 5
 --handlerInfo.marginTop = 5
 --handlerInfo.marginBottom = 5
 --handlerInfo.clearImgCacheOnStop = false
        
  handler = m_simpleTV.PositionThumbs.AddHandler(handlerInfo)
 
event function

function eventfunction(queryType,address,forTime)
 
 if queryType == 'testAddress' then
  --never called because we setted handlerInfo.regexString and testing address for this handler in core
  return false
 end
 
 if queryType == 'getThumbs' then
  --no need test address, we setted handlerInfo.regexString and testing address for this handler in core

  local t ={}
  t.playAddress = address
  
  --t.rawData -- for direct loading data of image, if setted then t.url, t.httpParams will be ignored
  t.url = url
  t.httpParams = {}
  --t.httpParams.userAgent
  --t.httpParams.proxy
  --t.httpParams.method
  --t.httpParams.body
  t.httpParams.extHeader = 'referer:' .. address
  
  t.elementWidth = elementWitdh
  t.elementHeight = elementHeight
  t.startTime = index * imgLen
  t.length = imgLen
 
  m_simpleTV.PositionThumbs.AppendThumb(t)
  
  return true
 end
 
end
----------------------------------------------------------------------------------



Редакция 2019-12-30 17:55 от SergeyVS
Описание add handler
  local handlerInfo={}
  handlerInfo.luaFunction = 'eventfunction'
  handlerInfo.regexString = 'regex string' --optional,by default empty
  handlerInfo.minImageWidth = 100 --optional,by default 200
 handlerInfo.minImageHeight = 200 --optional,by default 100
 handlerInfo.sizeFactor = 0.18 --optional,by default 0.2
 handlerInfo.backColor = ARGB(200,0,0,0) --optional,by default ARGB(255,0,0,0)
 handlerInfo.glowParams = 'glow="7" samples="5" extent="4" color="0xB0000000" ' --optional,by default empty
 --handlerInfo.textColor = ARGB(255,255,255,255) --optional,by default ARGB(255,255,255,255)
 --handlerInfo.marginLeft = 5
 --handlerInfo.marginRight = 5
 --handlerInfo.marginTop = 5
 --handlerInfo.marginBottom = 5
 --handlerInfo.clearImgCacheOnStop = false
        
  handler = m_simpleTV.PositionThumbs.AddHandler(handlerInfo)
 
event function

function eventfunction(queryType,address,forTime)
 
 if queryType == 'testAddress' then
  --never called because we setted handlerInfo.regexString and testing address for this handler in core
  return false
 end
 
 if queryType == 'getThumbs' then
  --no need test address, we setted handlerInfo.regexString and testing address for this handler in core

  local t ={}
  t.playAddress = address
  
  --t.rawData -- for direct loading data of image, if setted then t.url, t.httpParams will be ignored
  t.url = url
  t.httpParams = {}
  --t.httpParams.userAgent
  --t.httpParams.proxy
  --t.httpParams.method
  --t.httpParams.body
  t.httpParams.extHeader = 'referer:' .. address
  
  t.elementWitdh = elementWitdh
  t.elementHeight = elementHeight
  t.startTime = index * imgLen
  t.length = imgLen
 
  m_simpleTV.PositionThumbs.AppendThumb(t)
  
  return true
 end
 
end
----------------------------------------------------------------------------------



Редакция 2019-11-03 22:33 от SergeyVS
Описание add handler
  local handlerInfo={}
  handlerInfo.luaFunction = 'eventfunction'
  handlerInfo.regexString = 'regex string' --optional,by default empty
  handlerInfo.minImageWidth = 100 --optional,by default 200
 handlerInfo.minImageHeight = 200 --optional,by default 100
 handlerInfo.sizeFactor = 0.18 --optional,by default 0.2
 handlerInfo.backColor = ARGB(200,0,0,0) --optional,by default ARGB(255,0,0,0)
 handlerInfo.glowParams = 'glow="7" samples="5" extent="4" color="0xB0000000" ' --optional,by default empty
 --handlerInfo.textColor = ARGB(255,255,255,255) --optional,by default ARGB(255,255,255,255)
 --handlerInfo.marginLeft = 5
 --handlerInfo.marginRight = 5
 --handlerInfo.marginTop = 5
 --handlerInfo.marginBottom = 5
 --handlerInfo.clearImgCacheOnStop = false
        
  handler = m_simpleTV.PositionThumbs.AddHandler(handlerInfo)
 
event function

function eventfunction(queryType,address,forTime)
 
 if queryType == 'testAddress' then
  --never called because we setted handlerInfo.regexString and testing address for this handler in core
  return false
 end
 
 if queryType == 'getThumbs' then
  --no need test address, we setted handlerInfo.regexString and testing address for this handler in core

  local t ={}
  t.playAddress = address
  
  --t.rawData -- for direct loading data of image, if setted then t.url, t.httpParams will be ignored
  t.url = url
  t.httpParams = {}
  --t.httpParams.userAgent
  --t.httpParams.proxy
  t.httpParams.extHeader = 'referer:' .. address
  
  t.elementWitdh = elementWitdh
  t.elementHeight = elementHeight
  t.startTime = index * imgLen
  t.length = imgLen
 
  m_simpleTV.PositionThumbs.AppendThumb(t)
  
  return true
 end
 
end
----------------------------------------------------------------------------------