medium-editor-insert-plugin icon indicating copy to clipboard operation
medium-editor-insert-plugin copied to clipboard

How about video embed with thumbnail image?

Open bsdo64 opened this issue 9 years ago • 8 comments

In my app, embeding video is too slow when rendering because calling some scripts.

2016-01-11 3 52 24

How about changes embed video by thumbnails? http://www.sitepoint.com/faster-youtube-embeds-javascript/

bsdo64 avatar Jan 11 '16 06:01 bsdo64

I am also using medium-insert-plugin and embedding video is not slow for me.

My console log look like this

screen shot 2016-01-21 at 3 30 57 pm

In your console log, I see every script is called 7 times, may be you are binding events 7 times (unknowingly) . May be this is the reason embedding is slow for you.

anilmaurya avatar Jan 21 '16 10:01 anilmaurya

I have post list in one page app. In there there are more than 10 posts at one request (infinite scroll) Do you also request just 7 times while calling 10 videos?

bsdo64 avatar Jan 21 '16 10:01 bsdo64

I am not showing embedded videos on list page, instead I show thumbnail image on list page.

I show embedded video on post show page and editor.

Check this https://followme.co/anilmaurya2

anilmaurya avatar Jan 21 '16 10:01 anilmaurya

Listing 10 embedded video on single page will definitely slow page loading.

I implemented http://www.sitepoint.com/faster-youtube-embeds-javascript/ in earlier version of my editor, its not tough to implement and is light weight too.

+1 for this.

anilmaurya avatar Jan 21 '16 10:01 anilmaurya

Um... I'm showing posts list with all contents like facebook. I think I have to parse contents and change embeds to thumbnail image manually. Thank you anyway

bsdo64 avatar Jan 21 '16 10:01 bsdo64

@anilmaurya Yeah, if you have it, it would be great if you could submit a PR.

linkesch avatar Jan 22 '16 08:01 linkesch

@orthes I will work on it and send pull request in couple of days.

anilmaurya avatar Jan 23 '16 09:01 anilmaurya

If it helps, we just implemented this in our viewer using the "Faster YouTube Embeds with JavaScript" example.. This is the initial react component. The css is the same (from the example).

https://github.com/steemit/steemit.com/blob/43e32326e3405cbc7bc26898fab848ef4cf4b264/app/components/elements/YoutubePreview.jsx

jcalfee avatar Aug 25 '16 21:08 jcalfee