question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use VIDEO element instead of EMBED

See original GitHub issue

Are you requesting a feature, reporting a bug or asking a question?

Feature

What is the current behavior?

When an image question uses contentMode === 'video', SurveyJS uses an <embed> tag. In 2021 the video tag is well supported and the <embed> tag has been deprecated for a while.

I only noticed this behavior when looking into adding a feature for blocking the survey until a movie has finished playing.

What is the expected behavior?

I’d expect SurveyJS to use a video tag.

For illustration, this is the template for knockout:

<script type="text/html" id="survey-question-image">
  <div data-bind="css: question.koCss().root">
    <!-- ko if: question.contentMode === "image" -->
    <img data-bind="css: question.koCss().image, attr: { src: $data.imageLink, width: question.imageWidth ? question.imageWidth + 'px' : undefined, height: question.imageHeight ? question.imageHeight + 'px' : undefined, alt: question.text || question.title }, style: { objectFit: question.imageFit }"/>
    <!-- /ko -->
    <!-- ko if: question.contentMode === "video" -->
    <embed data-bind="css: question.koCss().image, attr: { src: $data.imageLink, width: question.imageWidth ? question.imageWidth + 'px' : undefined, height: question.imageHeight ? question.imageHeight + 'px' : undefined }, style: { objectFit: question.imageFit }"/>
    <!-- /ko -->
  </div>
</script>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tsv2013commented, Apr 23, 2021

@SamMousa In the new approach model will be shared, rendering should be implemented in a platform-specific way. Thus you can test a model for all the platforms, but markup should be tested separately for each platform

0reactions
tsv2013commented, Oct 28, 2021

We are frequently asked to implement native framework approach - use native react/angular/vue components. Our current architecture is the following: fat core framework-agnostic code which is covered by unit tests and used as a view model for thin presentation layer inplemented in react/angular/vue as a “dummy” renderer (components implement markup only). This allows to quickly support another framework as we did recently with survey-creator-react. And this will allow as to support native survey-angular library as we plan in the nearest future.

As for custom widgets - right now we’re thinking to obsolete old framework-independent custom widgets approach in favor of native react/angular/vue components to be used for widgets customization.

As for the initial thread topic - “Use VIDEO element instead of EMBED” - I move this issue into the current sprint incoming board and we’ll implement it as soon as we’ll have time for it. For me to be honest this change looks like a minor one until browsers still support the EMBED tag.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Video Embed element - HTML - MDN Web Docs - Mozilla
The HTML element embeds a media player which supports video playback into the document. You can use for audio content as well, ...
Read more >
How to Embed Video in HTML using iframe or video tag element
This article describes multiple ways to embed video in HTML documents using iframe and video tag. It also highlights important attributes ...
Read more >
HTML5 Video: How to Embed Video in Your HTML
The HTML <video> element is used to embed video in web documents. It may contain one or more video sources, represented using the...
Read more >
How to decide between video and embed? - HTML FAQ
Youtube uses the ,iframe, tag, which from my understanding is alot like putting a whole new tab within your tab, rather than embedding...
Read more >
How to Embed Video in HTML5 - Tutorial Republic
Using the HTML5 video Element. The newly introduced HTML5 <video> element provides a standard way to embed video in web pages. However, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found