Hi!
Can you update code: Extension talk:EmbedVideo#VK.COM support
Maybe like: Extension talk:EmbedVideo#OK support
I can not understand, but the old code for vk does not work.
Hi!
Can you update code: Extension talk:EmbedVideo#VK.COM support
Maybe like: Extension talk:EmbedVideo#OK support
I can not understand, but the old code for vk does not work.
And i dont use code for VK. He 2016 year. Maybe old.
And I dont unederstand howto add it to VideoServices.php
Code for OK very simple. I added it very fast, and it work.
I want same for VK. And work on EmbedVideo 2.7.0
Unlike most videoservices VK has 2 IDs for videopage and 3 IDs for embedded code (oid, id and hash), which calculated by some algorythms that VK was not publish. It is cause why VK embedding didn't support. But final embed code would receive from VK-page with video (see More -> Export
). There is additional help-function vkVideo(). It's just download VK-page with video by curl request, matches 3 necessary IDs (which was generated secretly somewhere in internals of VK company) and returns final iframe-tag with embed-code in it.
For your sample initial 2 IDs are 326617891 and 456240219
vkVideo() should match 3 IDs oid=326617891 id=456240219 and hash=b339b9fe9fce81a6
Due to EmbedVideo extension is able to work only with 1 ID there was need some trick to pass 3 IDs to vk section. Array value in line:
! $this->service['embed'],
was replaced with call of vkVideo(). Array value itself was "moved" into vkVideo(). At beginning it checks service and returns original value (if non-VK) or works as told above and returns prepared iframe-tag.
You need to add vk-section somewhere between existing ones, and add additional vkVideo() somewhere at the bottom of VideoServices.php but before $data = array(...)
. At $data = array(...)
need to replace line
! $this->service['embed'],
with line
! $this->vkVideo(),
Maybe you take my file and copy-paste how need to do work? Take: https://drive.google.com/open?id=1QRb1qro3YVUyWjpAAXjvL74e86PBapXD
After I look changes in WinMerge, and check, work it or not.
Suppose something like:
https://drive.google.com/open?id=13oIkyTSN_rxM--X3biUrmPbdA9zEyjlH
Cannot check if this code workable because I don't have fresh MW engine (I still use 1.21). If MW will fail with new code - first check web-server logs for php errors, their line number etc.
Not work: В тег EmbedVideo введен неверный id "https://vk.com/video326617891_456240219" видео для сервиса "vk".
I use tags:
{{#ev:vk|https://vk.com/video326617891_456240219}}
Log:
Warning: is_dir(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/h99724/data:.) in /home/h99724/data/www/my-site.ru/includes/libs/filebackend/fsfile/TempFSFile.php on line 90 | |
Call Stack: | |
0.0003 241448 1. {main}() /home/h99724/data/www/my-site.ru/index.php:0 | |
0.0008 277128 2. require('/home/h99724/data/www/my-site.ru/includes/WebStart.php') /home/h99724/data/www/my-site.ru/index.php:40 | |
0.0107 1717912 3. require_once('/home/h99724/data/www/my-site.ru/includes/Setup.php') /home/h99724/data/www/my-site.ru/includes/WebStart.php:137 | |
0.0146 2342216 4. wfTempDir() /home/h99724/data/www/my-site.ru/includes/Setup.php:613 | |
0.0148 2357472 5. TempFSFile::getUsableTempDirectory() /home/h99724/data/www/my-site.ru/includes/GlobalFunctions.php:2082 | |
0.0148 2358528 6. is_dir() /home/h99724/data/www/my-site.ru/includes/libs/filebackend/fsfile/TempFSFile.php:90 |
In logs something other than EmbedVideo issues because EmbedVideo doesn't operate with server's FS.
As could see additional code inserted correctly.. But appears suspicion that cause of problem is on VK side. I used this addition in my personal wiki-engine and now found that embedded vk-videos that recently worked well, now shows the same error message (ext and WM versions same as in past, videos still available on VK). Moreover, if to hardcode output of generated iframe code (copypasted from VK site) to output of vkVideo():
#return ($vkurl);
return('<iframe src="https://vk.com/video_ext.php?oid=326617891&id=456240219&hash=b339b9fe9fce81a6" width="640" height="360" frameborder="0" allowfullscreen></iframe>');
or directly to vk-section, extension shows the same error. Doubtly that issue bound with code/version oldness in this case.
Also need to check with anonymously accessible vk-video (to exclude auth factor)..
Yes, video dont access if not login in VK account.
But videos access on public there: https://vk.com/videos326617891
Sample public video link: https://vk.com/videos326617891?z=video326617891_456240219%2Fpl_326617891_-2