partials
5 years ago
custom-logo.php
5 years ago
elements.php
5 years ago
general.php
5 years ago
go-premium.php
5 years ago
license.php
5 years ago
main-template.php
5 years ago
twitch.php
5 years ago
vimeo.php
5 years ago
wistia.php
5 years ago
youtube.php
5 years ago
youtube.php
154 lines
| 1 | <?php |
| 2 | /* |
| 3 | * YouTube Settings page |
| 4 | * All undefined vars comes from 'render_settings_page' method |
| 5 | * */ |
| 6 | $yt_settings = get_option( EMBEDPRESS_PLG_NAME.':youtube'); |
| 7 | $autoplay = isset( $yt_settings['autoplay']) ? $yt_settings['autoplay'] : ''; |
| 8 | $controls = isset( $yt_settings['controls']) ? $yt_settings['controls'] : 1; |
| 9 | $fs = isset( $yt_settings['fs']) ? $yt_settings['fs'] : 1; |
| 10 | $iv_load_policy = isset( $yt_settings['iv_load_policy']) ? $yt_settings['iv_load_policy'] : 1; |
| 11 | // pro |
| 12 | $color = isset( $yt_settings['color']) ? $yt_settings['color'] : 'red'; |
| 13 | $cc_load_policy = isset( $yt_settings['cc_load_policy']) ? $yt_settings['cc_load_policy'] : ''; |
| 14 | $rel = isset( $yt_settings['rel']) ? $yt_settings['rel'] : 1; |
| 15 | $modestbranding = isset( $yt_settings['modestbranding']) ? $yt_settings['modestbranding'] : 0; |
| 16 | |
| 17 | ?> |
| 18 | |
| 19 | <div class="embedpress__settings background__white radius-25 p40"> |
| 20 | <h3><?php esc_html_e( "YouTube Settings", "embedpress" ); ?></h3> |
| 21 | <div class="embedpress__settings__form"> |
| 22 | <form action="" method="post" class="embedpress-settings-form" > |
| 23 | <?php |
| 24 | do_action( 'embedpress_before_youtube_settings_fields'); |
| 25 | echo $nonce_field ; ?> |
| 26 | <div class="form__group"> |
| 27 | <p class="form__label"><?php esc_html_e( "Auto Play", "embedpress" ); ?></p> |
| 28 | <div class="form__control__wrap"> |
| 29 | <div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $autoplay ); ?>" data-value="<?php echo esc_attr( $autoplay ); ?>"> |
| 30 | <label class="input__radio"> |
| 31 | <input type="radio" name="autoplay" value="" <?php checked( '', $autoplay); ?>> |
| 32 | <span><?php esc_html_e( "No", "embedpress" ); ?></span> |
| 33 | </label> |
| 34 | <label class="input__radio"> |
| 35 | <input type="radio" name="autoplay" value="1" <?php checked( '1', $autoplay); ?>> |
| 36 | <span><?php esc_html_e( "Yes", "embedpress" ); ?></span> |
| 37 | </label> |
| 38 | </div> |
| 39 | <p><?php esc_html_e( "Automatically start to play the videos when the player loads.", "embedpress" ); ?></p> |
| 40 | </div> |
| 41 | </div> |
| 42 | <div class="form__group"> |
| 43 | <label class="form__label" for="color"><?php esc_html_e( "Progress Bar Color", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>' : ''; ?></label> |
| 44 | <div class="form__control__wrap"> |
| 45 | <div class="embedpress__select <?php echo $pro_active ? '': 'isPro'; ?>"> |
| 46 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 47 | <select name="color" id="color" <?php echo !$pro_active ? 'disabled' : ''; ?> data-default="<?php echo esc_attr( $color ); ?>"> |
| 48 | <option value="red" <?php selected( 'red', $color); ?> ><?php esc_html_e( "Red", "embedpress" ); ?></option> |
| 49 | <option value="white" <?php selected( 'white', $color); ?> ><?php esc_html_e( "White", "embedpress" ); ?></option> |
| 50 | </select> |
| 51 | </div> |
| 52 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 53 | |
| 54 | <p><?php printf( esc_html__( "Specifies the color that will be used in the player's video progress bar to highlight the amount of the video that the viewer has already seen. %s Note: Setting the color to white will disable the Modest Branding option (causing a YouTube logo to be displayed in the control bar).", 'embedpress'), '<br>'); ?></p> |
| 55 | </div> |
| 56 | </div> |
| 57 | <div class="form__group"> |
| 58 | <p class="form__label"><?php esc_html_e( "Force Closed Captions", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>': ''; ?></p> |
| 59 | <div class="form__control__wrap"> |
| 60 | <div class="input__flex input__radio_wrap <?php echo $pro_active ? '': 'isPro'; ?>" data-default="<?php echo esc_attr( $cc_load_policy ); ?>" data-value="<?php echo esc_attr( $cc_load_policy ); ?>"> |
| 61 | <label class="input__radio"> |
| 62 | <input type="radio" name="cc_load_policy" value="" <?php echo !$pro_active ? 'disabled ' : ''; checked( '', $cc_load_policy); ?>> |
| 63 | <span><?php esc_html_e( "No", "embedpress" ); ?></span> |
| 64 | </label> |
| 65 | <label class="input__radio"> |
| 66 | <input type="radio" name="cc_load_policy" value="1" <?php echo !$pro_active ? 'disabled ' : ''; checked( '1', $cc_load_policy);?>> |
| 67 | <span><?php esc_html_e( "Yes", "embedpress" ); ?></span> |
| 68 | </label> |
| 69 | </div> |
| 70 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 71 | |
| 72 | <p><?php printf( esc_html__( "Setting this option to %s causes closed captions to be shown by default, even if the user has turned captions off. This will be based on user preference otherwise.", "embedpress" ), '<strong>Yes</strong>'); ?></p> |
| 73 | </div> |
| 74 | </div> |
| 75 | <div class="form__group"> |
| 76 | <p class="form__label"><?php esc_html_e( "Display Controls", "embedpress" ); ?></p> |
| 77 | <div class="form__control__wrap"> |
| 78 | <div class="embedpress__select"> |
| 79 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 80 | <select name="controls" data-default="<?php echo esc_attr( $controls); ?>"> |
| 81 | <option value="1" <?php selected( '1', $controls); ?>><?php esc_html_e( 'Display immediately', 'embedpress'); ?></option> |
| 82 | <option value="2" <?php selected( '2', $controls); ?>><?php esc_html_e( 'Display after user initiation', 'embedpress'); ?></option> |
| 83 | <option value="0" <?php selected( '0', $controls); ?>><?php esc_html_e( 'Hide controls', 'embedpress'); ?></option> |
| 84 | </select> |
| 85 | </div> |
| 86 | <p><?php esc_html_e( 'Indicates whether the video player controls are displayed.', 'embedpress'); ?> </p> |
| 87 | </div> |
| 88 | </div> |
| 89 | <div class="form__group"> |
| 90 | <p class="form__label"><?php esc_html_e( "Enable Fullscreen Button", "embedpress" ); ?></p> |
| 91 | <div class="form__control__wrap"> |
| 92 | <div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $fs ); ?>" data-value="<?php echo esc_attr( $fs ); ?>"> |
| 93 | <label class="input__radio"> |
| 94 | <input type="radio" name="fs" value="" <?php checked( '', $fs); ?> > |
| 95 | <span><?php esc_html_e( "No", "embedpress" ); ?></span> |
| 96 | </label> |
| 97 | <label class="input__radio"> |
| 98 | <input type="radio" name="fs" value="1" <?php checked( '1', $fs); ?>> |
| 99 | <span><?php esc_html_e( "Yes", "embedpress" ); ?></span> |
| 100 | </label> |
| 101 | </div> |
| 102 | <p><?php esc_html_e( "Indicates whether the fullscreen button is enabled.", "embedpress" ); ?></p> |
| 103 | </div> |
| 104 | </div> |
| 105 | <div class="form__group"> |
| 106 | <p class="form__label"><?php esc_html_e( "Display Video Annotations", "embedpress" ); ?></p> |
| 107 | <div class="form__control__wrap"> |
| 108 | <div class="embedpress__select"> |
| 109 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 110 | <select name="iv_load_policy" data-default="<?php echo esc_attr( $iv_load_policy ); ?>"> |
| 111 | <option value="1" <?php selected( '1', $iv_load_policy); ?>><?php esc_html_e( "Show", "embedpress" ); ?></option> |
| 112 | <option value="3" <?php selected( '3', $iv_load_policy); ?>><?php esc_html_e( "Hide", "embedpress" ); ?></option> |
| 113 | </select> |
| 114 | </div> |
| 115 | <p><?php esc_html_e( "Indicates whether video annotations are displayed.", "embedpress" ); ?></p> |
| 116 | </div> |
| 117 | </div> |
| 118 | <div class="form__group"> |
| 119 | <p class="form__label"><?php esc_html_e( "Display Related Videos", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>' : ''; ?></p> |
| 120 | <div class="form__control__wrap"> |
| 121 | <div class="embedpress__select <?php echo $pro_active ? '': 'isPro'; ?>"> |
| 122 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 123 | <select name="rel" data-default="<?php echo esc_attr( $rel); ?>" <?php echo $pro_active ? '' : 'disabled'; ?>> |
| 124 | <option value="" <?php selected( '', $rel); ?>><?php esc_html_e( "From the same channel of the video", "embedpress" ); ?></option> |
| 125 | <option value="1" <?php selected( '1', $rel); ?>><?php esc_html_e( "Based on User's watch history", "embedpress" ); ?></option> |
| 126 | </select> |
| 127 | </div> |
| 128 | |
| 129 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 130 | |
| 131 | <p><?php esc_html_e( "Indicates how the player should show related videos when playback of the video pauses or ends.", "embedpress" ); ?></p> |
| 132 | </div> |
| 133 | </div> |
| 134 | <div class="form__group"> |
| 135 | <p class="form__label"><?php esc_html_e( "Modest Branding", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>' : ''; ?></p> |
| 136 | <div class="form__control__wrap"> |
| 137 | <div class="embedpress__select <?php echo $pro_active ? '': 'isPro'; ?>"> |
| 138 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 139 | <select name="modestbranding" data-default="<?php echo esc_attr( $modestbranding); ?>" <?php echo !$pro_active ? 'disabled' : ''; ?>> |
| 140 | <option value="1" <?php selected( '1', $modestbranding); ?>><?php esc_html_e( "Hide", "embedpress" ); ?></option> |
| 141 | <option value="0" <?php selected( '0', $modestbranding); ?>><?php esc_html_e( "Show", "embedpress" ); ?></option> |
| 142 | </select> |
| 143 | </div> |
| 144 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 145 | |
| 146 | <p><?php esc_html_e( "Indicates whether the player should display a YouTube logo in the control bar.", "embedpress" ); ?></p> |
| 147 | </div> |
| 148 | </div> |
| 149 | <?php do_action( 'embedpress_after_youtube_settings_fields'); ?> |
| 150 | <button class="button button__themeColor radius-10 embedpress-submit-btn" name="submit" value="youtube"><?php esc_html_e( 'Save Changes', 'embedpress'); ?></button> |
| 151 | </form> |
| 152 | </div> |
| 153 | </div> |
| 154 |