oEmbed content should appear embedded immediately
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!
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?
maybe we could fake it in javascript?
will be solved using JSONP as soon as we have time for that
ok, thx for the info
Updated title to better fit in with other Diaspora bug requests.
Updated it again because we've never had this, so it's a feature rather than a bug. :)
very important feature for a nice UI. hope to see also the Vimeo embedding
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.
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 ;)
Is this still a problem after the update of oEmbed in https://github.com/diaspora/diaspora/pull/3880 ?
well, "problem" depends on the point of view... it's marked as 'feature' ;)
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.
So maybe we can close this? Or we wait to merge sidekiq stuff before close it?
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.
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.
Your solution looks good @Raven24