Video

Video

UI

  • (TBI) click the field name ‘url’ in the prop’s table to open asset table

template

  • editor.template.components.pageX.videos.video

    local props = {
      actionName    = "{{actionName}}",
      delay         = {{delay}},
      iterations    = {{iterations}},
      name          = "{{name}}",
    }
    
    return require("components.kwik.layer_video").new(props)

Video Replacement allows you to configure a video that will appear in replacement of an image layer. For example, you can draw a blank rectangle image in photoshop, and then you publish images to Solar2D project.In Kwik visiual editor, select the blank rectanglelayer you want to replace for a video and click Video replacement on Kwik editor.

Properties about the current layer content will appear when you click a layer in the list. It is important to match the same layer content size and position with the final video size.

  • File

    Use the Browser button to point to your external file (you may simply write an URL here if your video is available from a website, for example).

  • Width and Height

    these fields allow you to change the auto captured layer settings.

  • Auto Play

    When enabled, it will play the video in the moment the page starts.

  • Action

    It allows you to select an previously made action to be triggered when the video completes.

  • Loop

    it loops the video playing.

  • Rewind at end

    the video timeline is rewind back to the beginning.

module

  • components.kwik.layer_video

    local M = {}
    ...
    ...
    function M:didShow(UI)
      self.videoObj = video.performWithDelay( self.delay, function()
          if self.actionName then
            UI.scene:dispatchEvent({name = self.actionName })
          end
        end, self.iterations)
    end
    --

components.replacement.index

  • components.editor.video.index

    local model = {
      id ="video",
      props = {
        {name="actionName", value=""},
        {name="delay",      value=0},
        {name="iterations", value = 1},
        {name="name",       value = ""},
      }
    }
  • components.editor.video.defaults

    the order of the table must be as same as the model.props table in index and must be sorted in alphavetical order

    local M = {
      actionName = "",
      delay      = 0,
      iterations = 1,
      name       = "video-new",
    }