mccarthy-m-g / embedr Goto Github PK
View Code? Open in Web Editor NEWAn R package for embedding multimedia files in HTML documents.
License: Other
An R package for embedding multimedia files in HTML documents.
License: Other
As discussed in issue #2, Javascript is needed to style the audio element. howler.js paired with the htmlwidgets
package seems like a good way to accomplish this.
This enhancement should be started as an enhancement in a new development branch.
When adding this enhancement I should decide whether to create a unique function for it (e.g., embed_howlerjs()
) or to integrate it into the embed_audio()
function through an additional argument (e.g., embed_audio(src, ..., style = c("modern", "retro", "etc"))
).
I've go the following error;
> embed_audio(audio_file)
Error in is.audio(src) :
data/LibriSpeech/dev-clean/1993/147149/1993-147149-0011.flac does not end with a valid audio file extension; valid extensions are .mp3, .ogg, and .wav.
Some of the error messages would be more appropriately placed within utility functions, rather than within embed_audio()
and embed_video()
. Those error messages should be moved into the utility functions, and then I can just call the utility functions within embed_audio()
and embed_video()
instead of having the if statements for errors there.
I should add testing to prepare for a CRAN submission. The only catch to adding testing with my embed_media()
functions is their dependence on knitr::is_html_output()
to determine the value they return. I need to find a way to have knitr::is_html_output()
evaluate to TRUE
within a .R script file, otherwise I can’t test whether the HTML output is correct (I can only test the placeholder string).
Follow these steps to submit.
During the vignette build in R CMD check, the Windows build throws the following error:
"The URL: https://michaelmccarthy.netlify.app/files/embedr/audio-vignette.mp3 does not exist. Please use a valid URL."
This error message is built into the is.hosted()
utility function in the package. It occurs if RCurl::url.exists()
returns FALSE
. However, since the URL I'm using does exist (and both the OSX and Linux builds run without errors), this must be an issue with Windows or with RCurl
in Windows.
See this Actions build for verification of this issue.
I should try installing embedr
on a Windows machine to see if I can replicate this behaviour.
Update: I've opened an issue in the RCurl repository.
The HTML5 <audio>
tag does not have many options for CSS styling (its appearance is pretty much restricted to the browser defaults for the tag), however, JavaScript can be used to give audio elements a customized appearance. This can be done by adding an id argument to the tag and not specifying any attributes (e.g., <audio id=‘player’>
), along with JS code to handle the styling.
Adding this is desirable, as users may want to customize the player’s appearance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.