The basic function would be something like this…
function video_func() {
$gdrive = "<iframe src="http://video-source.com/page" width="640" height="480" frameborder="0" allowfullscreen></iframe>";
return $gdrive;
}
add_shortcode( 'videoplayer', 'video_func' );
As to what URL to use for the iFrame that you’re setitng up, that’s almost impossible to tell without knowing at least what video hosting platform you’re using. Most of the big ones (YouTube, Vimeo, etc) have good embed codes available for their videos, and a lot can be automatically embedded in yor page by just pasteing the URL into it.
Thread Starter
vl4d
(@vl4d)
is not youtube is custom link hosted by me, just i want this code with link=โvideolink.mp4โณ] how to make to work the X link from shortcode??
Thread Starter
vl4d
(@vl4d)
nothing?? :/ (sorry for double reply :/ )
Thread Starter
vl4d
(@vl4d)
soo i make the script but is not show nothing (the code is show up in view source but in front nothing)
function video_player( $atts ) {
extract( shortcode_atts( array (
'id' => ''
), $atts ) );
return '<iframe src="https://drive.google.com/file/' . $id . '/view" height="240" width="320" allowfullscreen="" frameborder="0"></iframe>';
}
add_shortcode ('player', 'video_player' );
[player id=”d/0Bx3KA2iVjV3LajNFalVoN1lfRHM”]
what is wrong???