Yeah, this is kind of on the track I am thinking, but I need to be able to dynamically search the iframe code to locate the width and then replace the value with “100%”.
Here is a screen shot of the input field that users will be inputting the code into.
The comment section is styled on a Facebook feed in its appearance and as you expect in Facebook, the media fills the post width to its defined dimensions. This is what I am trying to accomplish in this case.
As you can see in this image, I need to change the width of the code from “560” to “100%”
Here is another image of the iframe code from Vimeo
In the second image you can see that the width is “640” and is located in a different position within the code so I can’t simply truncate and replace.
If you look at the videos and how they appear, the YouTube clip doesn’t quite take up the full space and the Vimeo video overshoots the defined contained width.
To make my UI nice and clean, they need to be “100%” so they fill the space appropriately.
Hope this helps to clarify the problem.