SpringAll icon indicating copy to clipboard operation
SpringAll copied to clipboard

oEmbed content should appear embedded immediately

Open ghost opened this issue 15 years ago • 16 comments

steps to reproduce: post an oembed link, eg http://www.youtube.com/watch?v=Z3XuhvHflRQ if i press share it shares my post and it turns up under the sharing field, but without the oembed content (for ytube, the videoplayer)

but oembed is awesome, plz keep up your good work!

ghost avatar Oct 12 '11 13:10 ghost

That's because the pod has to get the information from youtube. this might take a while, so it's not already available on your pod when your post is rendered for the first time. so it's not really a bug, more a race condition. perhaps we could delay the response of the pod for about 100ms if you post a message with oembed?

manuels avatar Oct 12 '11 15:10 manuels

maybe we could fake it in javascript?

maxwell avatar Oct 12 '11 16:10 maxwell

will be solved using JSONP as soon as we have time for that

manuels avatar Oct 12 '11 17:10 manuels

ok, thx for the info

ghost avatar Oct 12 '11 18:10 ghost

Updated title to better fit in with other Diaspora bug requests.

DeadSuperHero avatar Jan 11 '12 20:01 DeadSuperHero

Updated it again because we've never had this, so it's a feature rather than a bug. :)

sarahmei avatar Jan 13 '12 04:01 sarahmei

very important feature for a nice UI. hope to see also the Vimeo embedding

mathisamicucci avatar Jan 15 '12 00:01 mathisamicucci

I think for simplicity it would suffice to just add a box saying "we're fetching your embedded content, please wait a few seconds..."? The post model already knows it contains something oEmbed-ed as soon as it is saved. It's just the content that takes a while.

Raven24 avatar Mar 13 '12 15:03 Raven24

it would be a good start, but the best solution would be something like fb...they fetch the content and then show it via ajax even before posting ;)

ghost avatar Mar 13 '12 16:03 ghost

Is this still a problem after the update of oEmbed in https://github.com/diaspora/diaspora/pull/3880 ?

Flaburgan avatar Mar 08 '13 14:03 Flaburgan

well, "problem" depends on the point of view... it's marked as 'feature' ;)

Raven24 avatar Mar 08 '13 14:03 Raven24

Also while doing the sidekiq stuff I noticed that we seem to already dispatch the job to gather the data before the post is fully persisted to the database and with sidekiq the pickup is fast enough so that job almost every time can't find the post on the first try. So it's hard to make this any faster.

jhass avatar Mar 08 '13 14:03 jhass

So maybe we can close this? Or we wait to merge sidekiq stuff before close it?

Flaburgan avatar Mar 08 '13 14:03 Flaburgan

I think we should pass the activated matchers from the oembed gem into the JS frontend, run them against the post if there's no oembed info for it (maybe only if the age of the post is < 30min, for performance reasons) and display a info box, that additional content is loaded.

jhass avatar Apr 06 '13 14:04 jhass

I think the ideal solution is a "best-effort" layered approach.

We can pass the matchers to JS, and at first just inform the user that a URL was inserted that will possibly produce content to be oEmbed-ed.

In the next step the URL gets passed to the D* server which fetches the oEmbed content according to our restrictions and answers with the oEmbed JSON (or an error message), so that we can display the preview in the publisher. This will populate the oEmbed content in our cache table, making a second lookup unnecessary, when the post is saved - and we get a nice preview in the publisher.

Of course, this means we need a new JSON route just for fetching remote oEmbed contents, which needs to be processed in the foreground, since we'd be waiting for a response.

Also, we will need to keep the current solution, in order for the DB entries to get associated correctly. The only thing that'd change would be that most oEmbedded content would already be cached, making a background lookup happen less often.

Raven24 avatar Apr 07 '13 13:04 Raven24

Your solution looks good @Raven24

Flaburgan avatar Apr 07 '13 19:04 Flaburgan