ritz078 / embed-js

🌻 A lightweight plugin to embed emojis, media, maps, tweets, code and more. ✨
https://codesandbox.io/s/Wp5OlNMn
MIT License
1.27k stars 89 forks source link

Video Click Handlers not working when using .text() instead of .render() #196

Closed enesemini closed 7 years ago

enesemini commented 7 years ago

Hey ritz078!

Once again, I was using your super awesome plugin, but came across an issue I don't know how to solve.

Due to some further processing of the output I have to do, I am using .text() instead of .render()

However, when I insert the HTML into the DOM the EventHandlers are not registered properly and the video will not play. I have tried using custom ClickEventHandlers, but no luck.

Here is a CodePen demonstrating a simplified version of this issue: http://codepen.io/anon/pen/ObYXQN

Am I missing something? How could I solve this problem? Is this actually a bug, or is this not intended to work?

Best Enes

ritz078 commented 7 years ago

when you are not using .render() the event listeners are not registered.

enesemini commented 7 years ago

Sure, I understood that, but how would you solve the problem?

Or actually, what is the actual usecase for .text() then?