GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
field-pipe_recorder-html.php
Go to the documentation of this file.
1 <?php
2 /**
3  * The default pipe (video) field output template.
4  *
5  * @global \GV\Template_Context $gravityview
6  * @since develop
7  */
8 
9 if ( ! isset( $gravityview ) || empty( $gravityview->template ) ) {
10  gravityview()->log->error( '{file} template loaded without context', array( 'file' => __FILE__ ) );
11  return;
12 }
13 
14 $value = $gravityview->value;
15 $display_value = $gravityview->display_value;
16 $field_settings = $gravityview->field->as_configuration();
17 
18 if ( ! empty( $field_settings['embed'] ) ) {
19  if ( $value = @json_decode( $value ) ) {
20  $no_video_description = __( 'Your browser does not support the video tag.', 'gk-gravityview' );
21  printf( '<video poster="%s" width="320" height="240" controls><source src="%s" type="video/mp4">%s</video>', esc_url( $value->thumbnail ), esc_url( $value->video ), esc_html( $no_video_description ) );
22  }
23 } else if ( is_string( $display_value ) ) {
24  echo $display_value;
25 }
gravityview()
The main GravityView wrapper function.
if(! isset( $gravityview)||empty( $gravityview->template)) $value
The default pipe (video) field output template.