1 | <?php global $wptv, $originalcontent; ?> |
---|
2 | |
---|
3 | <div class="secondary-content video-info"> |
---|
4 | <h5>Published</h5> |
---|
5 | <p class="video-date"><?php echo get_the_date(); ?></p> |
---|
6 | |
---|
7 | <?php if ( get_the_excerpt() ) : ?> |
---|
8 | <div class="video-description"><?php the_excerpt(); ?></div> |
---|
9 | <?php |
---|
10 | endif; |
---|
11 | |
---|
12 | $wptv->the_terms( 'event', '<h5>Event</h5><p class="video-event">', '<br /> ', '</p>' ); |
---|
13 | $wptv->the_terms( 'speakers', '<h5>Speakers</h5><p class="video-speakers">', '<br /> ', '</p>' ); |
---|
14 | $wptv->the_terms( 'post_tag', '<h5>Tags</h5><p class="video-tags">', '<br /> ', '</p>' ); |
---|
15 | $wptv->the_terms( 'language', '<h5>Language</h5><p class="video-lang">', '<br /> ', '</p>' ); |
---|
16 | |
---|
17 | if ( function_exists( 'find_all_videopress_shortcodes' ) ) { |
---|
18 | $videos = array_keys( find_all_videopress_shortcodes( $originalcontent ) ); |
---|
19 | if ( ! empty( $videos ) ) { |
---|
20 | $video = video_get_info_by_guid( $videos[0] ); |
---|
21 | $formats = array( 'fmt_std' => 'Low', 'fmt_dvd' => 'Med', 'fmt_hd' => 'High', 'fmt1_ogg' => 'Low' ); |
---|
22 | $mp4_links = array(); |
---|
23 | $ogg_link = NULL; |
---|
24 | foreach ( $formats as $format => $name ) { |
---|
25 | if ( 'fmt1_ogg' == $format ) { |
---|
26 | $link = video_highest_resolution_ogg( $video ); |
---|
27 | } else { |
---|
28 | $link = video_url_by_format( $video, $format ); |
---|
29 | } |
---|
30 | |
---|
31 | if ( empty( $link ) ) { |
---|
32 | continue; |
---|
33 | } |
---|
34 | |
---|
35 | if ( 'fmt1_ogg' == $format ) { |
---|
36 | $ogg_link = "<a href='$link'>$name</a>"; |
---|
37 | } else { |
---|
38 | $mp4_links[] = "<a href='$link'>$name</a>"; |
---|
39 | } |
---|
40 | } |
---|
41 | |
---|
42 | if ( ! empty( $mp4_links ) || ! empty( $ogg_link ) ) { |
---|
43 | ?> |
---|
44 | <h5>Download</h5> |
---|
45 | <div class="video-downloads"> |
---|
46 | <?php |
---|
47 | if ( ! empty( $mp4_links ) ) { |
---|
48 | echo 'MP4: ' . join( ', ', $mp4_links ) . '<br/>'; |
---|
49 | } |
---|
50 | if ( ! empty( $ogg_link ) ) { |
---|
51 | echo "OGG: $ogg_link"; |
---|
52 | } |
---|
53 | ?> |
---|
54 | </div> |
---|
55 | <?php |
---|
56 | } |
---|
57 | |
---|
58 | echo '<h5>Subtitles</h5>'; |
---|
59 | $ttml_links = array(); |
---|
60 | $languages = VideoPress_Subtitles::get_languages(); |
---|
61 | $subtitles = (array) get_post_meta( $video->post_id, '_videopress_subtitles', true ); |
---|
62 | |
---|
63 | foreach ( $subtitles as $track ) { |
---|
64 | if ( empty( $track['subtitles_post_id'] ) ) { |
---|
65 | continue; |
---|
66 | } |
---|
67 | |
---|
68 | $tracks[ $track['language'] ] = new VideoPress_Subtitles_Track( array( |
---|
69 | 'guid' => $video->guid, |
---|
70 | 'language' => $track['language'], |
---|
71 | 'subtitles_post_id' => $track['subtitles_post_id'], |
---|
72 | ) ); |
---|
73 | |
---|
74 | $ttml_links[] = '<a href="'. $tracks[ $track['language'] ]->url() .'">'. $languages[ $track['language'] ]['localized_label'] .'</a>'; |
---|
75 | } |
---|
76 | |
---|
77 | if ( ! empty( $ttml_links ) ) { |
---|
78 | echo 'TTML: ' . join( ', ', $ttml_links ) . '<br />'; |
---|
79 | } |
---|
80 | |
---|
81 | printf( '<a href="%s">Subtitle this video →</a>', esc_url( add_query_arg( 'video', $video->post_id, home_url( 'subtitle/' ) ) ) ); |
---|
82 | } |
---|
83 | } |
---|
84 | |
---|
85 | /* |
---|
86 | * Credit video producer with link to their WordPress.org profile |
---|
87 | * |
---|
88 | * In most cases we'll either have the producer name, or the username, but not both. |
---|
89 | */ |
---|
90 | $producer_name = get_the_terms( get_the_ID(), 'producer' ); |
---|
91 | $producer_username = get_the_terms( get_the_ID(), 'producer-username' ); |
---|
92 | ?> |
---|
93 | |
---|
94 | <?php if ( $producer_name || $producer_username ) : ?> |
---|
95 | <h5>Producer</h5> |
---|
96 | |
---|
97 | <div class="video-producer"> |
---|
98 | <?php if ( $producer_username ) : ?> |
---|
99 | |
---|
100 | <a href="<?php echo esc_url( 'https://profiles.wordpress.org/' . rawurlencode( $producer_username[0]->name ) ); ?>"> |
---|
101 | <?php if ( $producer_name ) : ?> |
---|
102 | <?php echo esc_html( $producer_name[0]->name ); ?> |
---|
103 | <?php else : ?> |
---|
104 | <?php echo esc_html( $producer_username[0]->name ); ?> |
---|
105 | <?php endif; ?> |
---|
106 | </a> |
---|
107 | |
---|
108 | <?php else : ?> |
---|
109 | |
---|
110 | <a href="<?php echo esc_url( wpcom_vip_get_term_link( $producer_name[0] ) ); ?>"> |
---|
111 | <?php echo esc_html( $producer_name[0]->name ); ?> |
---|
112 | </a> |
---|
113 | |
---|
114 | <?php endif; ?> |
---|
115 | </div> |
---|
116 | <?php endif; ?> |
---|
117 | |
---|
118 | </div><!-- .secondary-content --> |
---|