Hi,
the best way(even the most simple) is to extend this functionality to video field type.
to do this you must change 2 files: 1) Rule to accept other URL (like vimeo or vine) and 2) Output
1) Rule
open file /administrator/com_jsn/models/rule/video.php
in this file is present a validation of URL. You can see at line 97 the validation for youtube path
example for Vimeo
change line 97 from
if(!(strpos(' '.$value,'https://www.youtube.com/watch?v=')==1 || strpos(' '.$value,'http://www.youtube.com/watch?v=')==1 || strpos(' '.$value,'m.youtube.com/watch?v=" >https://m.youtube.com/watch?v=')==1 || strpos(' '.$value,'http://www.youtube.com/watch?v=')==1 || strpos(' '.$value,'http://youtu.be/')==1)) return false;
to
if(!(strpos(' '.$value,'https://www.youtube.com/watch?v=')==1 || strpos(' '.$value,'http://www.youtube.com/watch?v=')==1 || strpos(' '.$value,'m.youtube.com/watch?v=" >https://m.youtube.com/watch?v=')==1 || strpos(' '.$value,'http://www.youtube.com/watch?v=')==1 || strpos(' '.$value,'http://youtu.be/')==1 || strpos(' '.$value,'http://vimeo.com/')==1 || strpos(' '.$value,'https://vimeo.com/')==1)) return false;
2) Output
open file /administrator/com_jsn/helpers/fields/video.php
at line 82 you will find a function "video", this function set output of video field
example for Vimeo
add this code before line 91 (see screenshot)
if(strpos(' '.$value,'vimeo')>1)
{
$value=substr($value,strrpos($value,'/')+1);
return '<iframe src="//http://player.vimeo.com/video/'.$value.'?portrait=0&badge=0" width="500" height="209" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
}
In future we will add many other providers.
NOTE: this code is not supported and will be delete when you update Easy Profile.