#1310 - oEmbed support (input)

Post

Posted
Rating:
#11159

Comment: #catalogue_entry_1774

This will now work. It's actually the 3rd pattern of Facebook video URL we've seen now :S.

/**
* See if we can recognise this URL pattern.
*
* @param URLPATH URL to pattern match
* @return integer Recognition precedence
*/
function recognises_url($url)
{
if (preg_match('#^https?://www\.facebook\.com/video/video\.php\?v=(\w+)#',$url)!=0) return MEDIA_RECOG_PRECEDENCE_HIGH;
if (preg_match('#^https?://www\.facebook\.com/video\.php\?v=(\w+)#',$url)!=0) return MEDIA_RECOG_PRECEDENCE_HIGH;
if (preg_match('#^https?://www\.facebook\.com/photo\.php\?v=(\w+)#',$url)!=0) return MEDIA_RECOG_PRECEDENCE_HIGH;
return MEDIA_RECOG_PRECEDENCE_NONE;
}

Post

Posted
Rating:
#11160
wow, too bad they're not consistent! Thanks

Post

Posted
Rating:
#11166
Hello Chris,

Here's another mysterious embedding issue with someone's recent blog post--

http://www.saivasiddhanta.org/site/index.php?page=news&type=view&id=rajakumar-ramasamys%2Fthree-eyed-cow-born-in&blog=1

The youtube video didn't embed. The URL is not in a <a> tag like what you mentioned earlier, however it does have some strange "advenueINTEXT" stuff in front of it. I tried removing that (and removed the <span> tag entirely), so it would just be the plain URL, but it still won't embed.

I made a new blog post and pasted in the same URL (along with some dummy text) and it embedded fine.

Mysterious!

Post

Posted
Rating:
#11167
Okay, this was a Comcode limitation.

Previously it would only detect URLs posted in pure Comcode, not within semihtml.
You would not normally notice as I coded it to convert simple semihtml with URLs back into pure Comcode.

In this case the HTML had more complexity so it would not convert.


I have resolved it though.
Basically I have allowed the Comcode parser to detect URLs within semihtml IF the number of "<" and ">" to the left of the URL match, i.e. if it is not inside an HTML tag at that point of the parsing. i.e. I have given it some minimal HTML awareness so that it was safe for me to include this.

Post

Posted
Rating:
#11168
Great, thanks Chris

Post

Posted
Rating:
#11170
Hello,

Regarding adding CNN videos to galleries, when I paste a video URL into the URL field, it only results in a link with thumbnail of the video. It doesn't embed the video.

http://www.cnn.com/video/data/2.0/video/world/2014/10/02/navandra-modi-orig-cfb.cnn.html

The only way I was able to embed the video into a gallery entry was to copy the embed code from CNN page--
<iframe width="416" height="234" src="http://www.cnn.com/video/api/embed.html#/video/world/2014/10/02/navandra-modi-orig-cfb.cnn" frameborder="0"></iframe>

and paste that in the video entry description field in Source view.

http://www.saivasiddhanta.org/site/index.php?page=galleries&type=video&id=cnn-video-is-this&wide=1&redirected=1

Post

Posted
Rating:
#11171
Another case of a URL variant. Fixed.

Post

Posted
Rating:
#11172
okay, thanks! Hope they won't keep changing frequently :)

Post

Posted
Rating:
#11186
Hello,

Now I'm seeing a youtube video not embedding in a blog post which uses simple list in its layout--

http://www.saivasiddhanta.org/site/index.php?page=news&type=view&id=moilavadee-moorghen-s%2Fannual-student-prayer&blog=1

Here is some content surrounding one of the two videos trying to be embedded--

<ol style="list">
<li value="7">
Preparing the gifts to be distributed to the students after the ceremony.&nbsp; This is really a big challenge for we are preparing some 4,000 gift pouches consisting of a blessed pen, pencil and vibhuti pack to be used for the exams.&nbsp; The design for the pouch and the vibhuti packs were&nbsp; made and then submitted for printing.&nbsp; Then the small vibhuti packs along with big vibhuti packets were distributed to our kutumba members and some close family members for filling with vibuthi.&nbsp; Meanwhile the 4,000 pens and pencils were ordered and received.&nbsp; Then the big preparing and packing up was fixed for Sunday 28<sup>th</sup> September at our place.&nbsp; Everyone came with their small vibbhuti packs duly filled and the packing up started around 1 p.m. until very late in the evening.&nbsp; We had a tea break in the afternoon with cakes and refreshments.&nbsp; It was real fun for all of us with lots of funny jokes and laughter.&nbsp; Later, we all&nbsp; had a nice dinner together. We&nbsp; share below some photos of this most wonderful and rewarding day</li>
</ol>
&nbsp;http://youtu.be/t2wyDKDXPB0

<ol style="list">
<li value="8">

Post

Posted
Rating:
#11187
I think this is likely because the Comcode parser doesn't see the nbsp entity (non-breaking space) as whitespace, as it isn't reading the actual HTML. So from its perspective, the URL is stuck on the end of that entity.

I'll see if we can make the parser slightly smarter about this.

Post

Posted
Rating:
#11188
Actually it was a different cause. It should be fixed on your site now. The content will need to be passed through an edit though, so the Comcode gets re-compiled.

Post

Posted
Rating:
#11189
Thanks Chris!

Post

Posted
Rating:
#11386
Hello, I tried to add a Vimeo video on our website--

http://vimeo.com/49976720

And got the following error--


Stack trace…

File -> '/home/saiva/public_html/sources/failure.php'
Line -> 693
Function -> 'die_html_trace'
Args -> array ( 0 => 'PHP NOTICE [8] Undefined index: remote_id in sources/hooks/systems/media_rendering/vimeo.php on line 126 (version: 9.0.2, PHP version: 5.5.15, URL: /site/index.php?page=galleries&amp;type=video&amp;id=swiss-festival-honors&amp;wide=1&amp;redirected=1)', )

File -> '/home/saiva/public_html/sources/global.php(206) : eval()\'d code'
Line -> 1017
Function -> '_fatal_exit'
Args -> array ( 0 => 'PHP NOTICE [8] Undefined index: remote_id in sources/hooks/systems/media_rendering/vimeo.php on line 126', )

File -> '/home/saiva/public_html/sources/failure.php'
Line -> 220
Function -> 'fatal_exit'
Args -> array ( 0 => 'PHP NOTICE [8] Undefined index: remote_id in sources/hooks/systems/media_rendering/vimeo.php on line 126', )

File -> '/home/saiva/public_html/sources/global.php(206) : eval()\'d code'
Line -> 878
Function -> '_Composr_error_handler'
Args -> array ( 0 => 'notice', 1 => 8, 2 => 'Undefined index: remote_id', 3 => 'sources/hooks/systems/media_rendering/vimeo.php', 4 => 126, )

File -> '/home/saiva/public_html/sources/hooks/systems/media_rendering/vimeo.php'
Line -> 126
Function -> 'Composr_error_handler'
Args -> array

File -> '/home/saiva/public_html/sources/media_renderer.php'
Line -> 202
Function -> 'render'
Class -> 'Hook_media_rendering_vimeo'
Object -> Hook_media_rendering_vimeo::__set_state(array( ))
Type -> '->'
Args -> array ( 0 => 'http://vimeo.com/49976720', 1 => 'http://vimeo.com/49976720', 2 => array ( 'thumb_url' => 'http://i.vimeocdn.com/video/344524902_1280x720.jpg', 'width' => '1280', 'height' => '720', 'length' => '0', 'mime_type' => 'application/octet-stream', ), 3 => true, 4 => 59, )

Post

Posted
Rating:
#11389
Hello, the above is now fixed.

Post

Posted
Rating:
#11392
thanks!

Post

Posted
Rating:
#11765
Hello Chris,

Looks like we have yet another pattern of facebook video URL that isn't yet displayable by our video galleries. Here is an example--

https://www.facebook.com/indians.incredible.india/videos/vb.330928850251065/999642426713034/?type=1&theater

Post

Posted
Rating:
#11768
Fixed. Updated sources/hooks/systems/media_rendering/video_facebook.php on your site.

Post

Posted
Rating:
#11769
many thanks :)

Post

Posted
Rating:
#11804
Hello Chris,

I went to add this facebook video to galleries just now--

https://www.facebook.com/UCBerkeley/videos/10153311993674661/

and it didn't embed, just showed a link

Post

Posted
Rating:
#11807
Fixed.
6 guests and 0 members have recently viewed this.