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.

htmlwidget with media elements not working in WebView

See original GitHub issue

Some htmlwidgets might contain multimedia elements. They are currently not working properly in WebView.

For example, {gm} can be used to generate music scores and playable audio with the following demo code:

library(gm)

m <- 
  # initialize a Music object
  Music() +
  # add a 4/4 time signature
  Meter(4, 4) +
  # add a musical line of four quarter notes
  Line(list("C5", "D5", "E5", "F5"), list(1, 1, 1, 1))

show(m, to = c("score", "audio"))  

Its HTML is simple:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div>
  <p>
    <img src="file12eef7447e4b9.png" style="max-width: 100%;"/>
  </p>
  <p>
    <audio controls>
      <source src="file12eef7447e4b9.mp3" type="audio/mp3"/>
    </audio>
  </p>
</div>
</body>
</html>

From the developer tools, the URIs seems to be correctly replaced with vscode-resource scheme but still not working.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
renkun-kencommented, Dec 11, 2021

I tried adding "SOURCE" to watchedTags but it does not work. Looks like it is a known limitation (https://github.com/microsoft/vscode/issues/54097). There are some other notebook-related issues regarding video/audio: https://github.com/microsoft/vscode/issues/118275, https://github.com/microsoft/vscode/issues/119127.

0reactions
renkun-kencommented, Dec 16, 2022

<media> element has been supported since 1.72. Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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