Comments (9)
FWIW, this seems to work too (including the css from above):
```{r, echo = FALSE}
library("vembedr")
library("htmltools")
embed_youtube("DQiKHlpy70Q") %>% div(class = "vembedr")
```
from vembedr.
Reconsidering, given that I am looking to create a function called div_bs_responsive()
.
This could be a function something like:
div_rounded <- function(..., radius = 50)
we could use htmltools::htmlDependencies() to make sure the CSS comes along for the ride...
from vembedr.
Although interesting, I think this is outside the scope of what (as least I think) the package does.
For me, the mission of this package begins and ends at the <iframe/>
.
I am interested (outside of this package) to see how rounded corners could be implemented - from my poking around, I see there is some difficulty in Chrome.
from vembedr.
Hi,
no worries, I get your point of view.
Actually, you don't need to change anything, @koncina found a css
solution that works well. Your package is used within his tweaked version of ioslides
, called iosp
this code:
## Art | by Marcus Volz
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">A compilation of some of my gifs created with <a href="https://twitter.com/hashtag/rstats?src=hash">#rstats</a> <a href="https://twitter.com/hashtag/ggplot2?src=hash">#ggplot2</a> <a href="https://twitter.com/hashtag/gganimate?src=hash">#gganimate</a> <a href="https://twitter.com/hashtag/tweenr?src=hash">#tweenr</a> <a href="https://t.co/nCppSOZv4W">https://t.co/nCppSOZv4W</a></p>— Marcus Volz (@mgvolz) <a href="https://twitter.com/mgvolz/status/849375922297991168">4 avril 2017</a></blockquote>
```{css}
.vembedr {
border-radius: 50px;
overflow: hidden;
border: 2px solid black;
}
.vembedr iframe {
margin: -5px;
width: calc(100% + 10px);
}
```
<div class = "vembedr">
```{r, echo = FALSE}
vembedr::embed_youtube("DQiKHlpy70Q")
```
</div>
Of note, it works with both Chrome and Firefox on mac and GNU/Linux
from vembedr.
That looks excellent!
In that case, with @konica's permission, maybe the thing to do is to put this into a vignette.
Reopening!
from vembedr.
I'm fine with that.
The code can even be simplified by displaying the iframe as a block (I also removed the border for the container as it is optional):
```{css}
.vembedr {
border-radius: 50px; /* adjust it to your needs */
overflow: hidden;
}
.vembedr iframe {
display: block;
border: none;
}
```
<div class = "vembedr">
```{r, echo = FALSE}
vembedr::embed_youtube("DQiKHlpy70Q")
```
</div>
from vembedr.
thanks Eric! And sorry for the user konica (~ koncina) who received an unintended message from Ian ;)
from vembedr.
Thanks Eric, and sorry to you both! I will get on this!
from vembedr.
Just added this stuff to README, thanks!
from vembedr.
Related Issues (20)
- support SoundCloud
- Play video HOT 2
- support Box videos HOT 1
- Document
- suggest_embed() to use usethis::ui_code_block()
- specify aspect-ratio
- Embed local file HOT 4
- tiktok
- Support Microsoft Stream
- use github actions
- use S3 dispatch for parse_video_url()
- refactor to facilitate adding new services
- rework testing
- Release vembedr 0.1.4
- clean up for CRAN
- deprecate channel 9
- move `master` to `main`
- Release vembedr 1.5.0
- remove channel-9 functions
- embed_youtube(width = 'auto', height = 'auto')
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vembedr.