';
$html .= '
' . esc_html( __( 'This video is intended for mature audiences.', 'jetpack' ) ) . ' ' . esc_html( __( 'Please verify your birthday.', 'jetpack' ) ) . '
';
$html .= '
';
$inputs_style = 'border:1px solid #444;margin-';
if ( $this->video->text_direction === 'rtl' ) {
$inputs_style .= 'left';
} else {
$inputs_style .= 'right';
}
$inputs_style .= ':10px;background-color:rgb(0, 0, 0);font-size:14px;color:rgb(255,255,255);padding:4px 6px;line-height: 2em;vertical-align: middle';
/**
* Display a list of months in the Gregorian calendar.
* Set values to 0-based to match JavaScript Date.
*
* @link https://developer.mozilla.org/en/JavaScript/Reference/global_objects/date Mozilla JavaScript Reference: Date
*/
$html .= '';
for ( $i = 0; $i < 12; $i++ ) {
$html .= '' . esc_html( $wp_locale->get_month( $i + 1 ) ) . ' ';
}
$html .= ' ';
/**
* todo: numdays variance by month
*/
$html .= '';
for ( $i = 1; $i < 32; $i++ ) {
$html .= '' . $i . ' ';
}
$html .= ' ';
/**
* Current record for human life is 122. Go back 130 years and no one is left out.
* Don't ask infants younger than 2 for their birthday
* Default to 13
*/
$html .= '';
$start_year = date( 'Y' ) - 2;
$default_year = $start_year - 11;
$end_year = $start_year - 128;
for ( $year = $start_year; $year > $end_year; $year-- ) {
$html .= '';
}
unset( $start_year );
unset( $default_year );
unset( $end_year );
$html .= ' ';
$html .= ' ';
$html .= ' ';
$html .= '
' . __( 'More information', 'jetpack' ) . '
';
$html .= '
';
return $html;
}
/**
* Return HTML5 video static markup for the given video parameters.
* Use default browser player controls.
* No Flash fallback.
*
* @since 1.2
* @link https://html.spec.whatwg.org/multipage/media.html#the-video-element HTML5 video
* @return string HTML5 video element and children
*/
private function html5_static() {
wp_enqueue_script( 'videopress' );
$thumbnail = esc_url( $this->video->poster_frame_uri );
$html = "video->skin ) && isset( $this->video->skin->background_color ) ) {
$html .= 'background-color:' . esc_attr( $this->video->skin->background_color ) . ';';
}
$html .= 'font-family: \'Helvetica Neue\',Arial,Helvetica,\'Nimbus Sans L\',sans-serif;font-weight:bold;font-size:18px">' . PHP_EOL;
/**
* Do not display a poster frame, title, or any other content hints for mature content.
*/
if ( ! $age_gate_required ) {
if ( ! empty( $this->video->title ) ) {
$html .= '
video->language ) ) {
$html .= ' lang="' . esc_attr( $this->video->language ) . '"';
}
$html .= '>' . esc_html( $this->video->title ) . '
';
}
$html .= '
' . PHP_EOL;
// style a play button hovered over the poster frame
$html .= '
▶
' . PHP_EOL;
// watermark
if ( isset( $this->video->skin ) && isset( $this->video->skin->watermark ) ) {
$html .= '
';
$html .= '
';
$html .= '
' . PHP_EOL;
}
}
$data = array(
'blog' => absint( $this->video->blog_id ),
'post' => absint( $this->video->post_id ),
'duration' => absint( $this->video->duration ),
'poster' => esc_url_raw( $this->video->poster_frame_uri, array( 'http', 'https' ) ),
'hd' => (bool) $this->options['hd'],
);
if ( isset( $this->video->videos ) ) {
if ( isset( $this->video->videos->mp4 ) && isset( $this->video->videos->mp4->url ) ) {
$data['mp4'] = array(
'size' => $this->video->videos->mp4->format,
'uri' => esc_url_raw( $this->video->videos->mp4->url, array( 'http', 'https' ) ),
);
}
if ( isset( $this->video->videos->ogv ) && isset( $this->video->videos->ogv->url ) ) {
$data['ogv'] = array(
'size' => 'std',
'uri' => esc_url_raw( $this->video->videos->ogv->url, array( 'http', 'https' ) ),
);
}
}
$locale = array( 'dir' => $this->video->text_direction );
if ( isset( $this->video->language ) ) {
$locale['lang'] = $this->video->language;
}
$data['locale'] = $locale;
unset( $locale );
$guid = $this->video->guid;
$guid_js = json_encode( $guid );
$html .= '' . PHP_EOL;
$html .= '
' . PHP_EOL;
/*
* JavaScript required
*/
$noun = __( 'this video', 'jetpack' );
if ( ! $age_gate_required ) {
$vid_type = '';
if ( ( isset( $this->options['freedom'] ) && $this->options['freedom'] === true ) && ( isset( $this->video->videos->ogv ) && isset( $this->video->videos->ogv->url ) ) ) {
$vid_type = 'ogv';
} elseif ( isset( $this->video->videos->mp4 ) && isset( $this->video->videos->mp4->url ) ) {
$vid_type = 'mp4';
} elseif ( isset( $this->video->videos->ogv ) && isset( $this->video->videos->ogv->url ) ) {
$vid_type = 'ogv';
}
if ( $vid_type !== '' ) {
$noun = '