openhab-webui icon indicating copy to clipboard operation
openhab-webui copied to clipboard

Bug in oh-video and oh-video-card components

Open mesetka opened this issue 1 year ago • 0 comments

When i call a separate popover widget from another widget and pass to that widget item's name in modalConfig/props, and this widget contains oh-video or oh-video-card component which is supposed to use that item's state as a source for url property, then the video is not showing up and video player shows "The media could not be loaded...". If i'll close the popovered widget and reopen it again - video player suddenly accepts item's state as url property. If i'll use that item as item property, then there is no problem with the video player. The bug cannot be reproduced in widget preview, only in the way i've described - a call for widget from another widget. Inspecting the video player element shows up that he got NaN instead of item's state.

Expected behavior

url and item properties of oh-video and oh-video-card components function in the same way with passed props.

Steps to reproduce

  1. The first, parent widget:

uid: ClickablePTZCamera
tags:
  - video
props:
  parameters:
    - context: item
      label: Camera image URL
      name: camerajpeg
      required: true
      type: TEXT
   - context: item
      description: Ipcamera MP4 history length item
      label: MP4 history length
      name: history
      required: true
      type: TEXT
timestamp: Aug 10, 2022, 8:41:38 PM
component: f7-card
config:
  style:
    border-radius: var(--f7-card-expandable-border-radius)
    box-shadow: 5px 5px 10px 1px var(--f7-bars-bg-color)
    color: var(--f7-text-color)
    font-size: medium
    font-weight: 500
    max-height: 150px
    noShadow: false
slots:
  default:
    - component: oh-image
      config:
        action: popover
        actionModal: widget:Video
        actionModalConfig:
          history: =props.history
        item: =[props.camerajpeg]
        lazy: true
        style:
          border-radius: var(--f7-card-expandable-border-radius)
          height: 150px
          margin: 0px
          padding: 0px
          width: 100%
          z-index: -2

  1. And second, child widget:

uid: Video
tags:
  - video
props:
  parameters:
    - context: item
      description: Ipcamera MP4 history length item
      label: MP4 history length
      name: history
      required: true
  parameterGroups: []
timestamp: Aug 10, 2022, 9:36:42 PM
component: f7-block
config:
  class: .videoPopover
  style:
    margin: 0
    margin-left: auto
    noShadow: false
    padding: 0
    color: (--var-f7-text-color)
    text-shadow: 1px 0px 2px black, -1px 0px 2px black, 0px 0px 2px black, 0px 0px 3px black
    width: 97%
slots:
  default:
    - component: oh-video
      config:
        hideControls: false
        startManually: false
        url: ="items[props.history].state"

mesetka avatar Aug 10 '22 23:08 mesetka