Digital experiences for all disciplines
New Landing › How can we help? › Cardinal › Fullscreen video button shortcode doesn't support timestamp forwarding
New Landing › How can we help? › Cardinal › Fullscreen video button shortcode doesn't support timestamp forwarding
- This topic has 3 replies, 2 voices, and was last updated 8 years by Mohammad – SUPPORT.
-
Posted in: Cardinal
-
January 7, 2016 at 11:39 pm #238965
Hey Team, the fullscreen video feature is pretty sweet. And it does work perfect for typical Vimeo video display. However, I need to be able to utilize the “start playing from a specific time” feature of a Vimeo video like such: https://vimeo.com/138992890#t=11m43s
This kind of link works fine as a standard text link, but not as part of the fullscreen button. Note the additional info after the # sign. Is there a way to incorporate this in the fullscreen button link? I’m currently using the following shortcode:
[sf_fullscreenvideo type="text-button" btntext="Barbara Harness" imageurl="" videourl="https://vimeo.com/138992890#t=11m43s" extraclass="button-video-plaintext"]
The class I’ve added merely changes the button style. Thoughts? Any help would be greatly appreciated. Thanks in advance!
January 8, 2016 at 11:48 am #239090Hi,
Please paste this code functions.php of child theme.function sf_get_embed_src( $url ) { if ( strpos( $url, 'youtube' ) ) { preg_match( '/[\\?\\&]v=([^\\?\\&]+)/', $url, $video_id ); $youtube_params = apply_filters( 'sf_youtube_embed_src_params', '?autoplay=1' ); if ( is_ssl() ) { if ( isset( $video_id[1] ) ) { return 'https://www.youtube.com/embed/' . $video_id[1] . $youtube_params; } } else { if ( isset( $video_id[1] ) ) { return 'http://www.youtube.com/embed/' . $video_id[1] . $youtube_params; } } } else { $url = str_replace( 'https://', 'http://', $url ); $video_id = sf_get_vimeoid( $url ); $time_stamp = explode('#',$url); $video_id = (!empty($time_stamp[1]))?$video_id.'#'.$time_stamp[1]:$video_id $vimeo_params = apply_filters( 'sf_vimeo_embed_src_params', '?title=0&byline=0&portrait=0&autoplay=1' ); if ( is_ssl() ) { if ( $video_id != "" ) { return 'https://player.vimeo.com/video/' . $video_id . $vimeo_params; } } else { if ( $video_id != "" ) { return 'http://player.vimeo.com/video/' . $video_id . $vimeo_params; } } } }
Thanks
MohammadJanuary 8, 2016 at 5:16 pm #239200Mohammed – thanks for the assist! This function does work a treat – but for any future users out there, the code was a missing ; on line 18. Might this get added to the base Cardinal theme going forward?
January 11, 2016 at 11:23 am #239443Hi,
You most welcome and glad to help you.
Thanks
Mohammad -
Posted in: Cardinal
You must be logged in to reply to this topic.