K
K
kost_orchestra2019-08-13 00:32:49
Video broadcast
kost_orchestra, 2019-08-13 00:32:49

How to insert graphics into an online broadcast, small blocks with information that are attached to different moving objects?

The crux of the matter is this: the camera is broadcasting live from a small pond with ducks. No more than 8-12 ducks at a time, on average 2-5 pieces. On the monitors above each bird, we see a small counter that shows the number of seconds each bird spent in the frame.
Can this be done in "home" conditions in terms of iron?
It seems to be similar to the operation of the face recognition system, but without loading additional data, only one parameter of the object is tracked and displayed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew Ghostuhin, 2018-01-04
@myskypesla

In your example, we are talking about a simple expandBlock using the transition directive.
The trick is that the text is initially loaded and lives in the house, in this case there is no need to "listen" to changes in the house node and load something after the object is initialized.
You just need to:
- upload objects to the house
- wait for the collapse / expand
- give the already loaded content

Vue.directive('expand', {
    inserted: function(el, binding)
    {
        if (binding.value !== null)
        {
            function calcHeight()
            {
                const currentState = el.getAttribute('aria-expanded')

                el.classList.add('u-no-transition')
                el.removeAttribute('aria-expanded')
                el.style.height = null
                el.style.height = el.clientHeight + 'px'
                el.setAttribute('aria-expanded', currentState)

                setTimeout(function()
                {
                    el.classList.remove('u-no-transition')
                })
            }

            el.classList.add('expand')
            el.setAttribute('aria-expanded', (binding.value) ? 'true' : 'false')
            calcHeight()
            window.addEventListener('resize', calcHeight)
        }
    },
    update: function(el, binding)
    {
        if (el.style.height && binding.value !== null)
        {
            el.setAttribute('aria-expanded', (binding.value) ? 'true' : 'false')
        }
    },
})

var app = new Vue({
    el: '#app',
    data: {
        isExpanded: false
    }
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question