Plugin Directory

Changeset 3327829


Ignore:
Timestamp:
07/14/2025 11:21:46 PM (9 months ago)
Author:
openvideo
Message:

support domain hosted video urls in block

Location:
open-video/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • open-video/trunk/README.txt

    r3326432 r3327829  
    66Tested up to: 6.8
    77Requires PHP: 7.0
    8 Stable tag: 1.0.4
     8Stable tag: 1.1.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2727
    2828== Changelog ==
     29= 1.1.0 =
     30* Add support for domain hosted videos in Open.Video Block
     31
    2932= 1.0.4 =
    3033* Description updates
  • open-video/trunk/open-video-block/src/consts.js

    r3320896 r3327829  
    1 export const OPENVIDEOPLUGIN_REGEX = /^https?:\/\/(www\.)?(open\.video\/(?:@[\w-]+\/)?((video|v)\/(playlist\/)?[\w-]+)|[\w.-]+\/open-video\/(playlist\/)?[\w-]+)([\?&][\w-]+=[\w-]*)*$/;
     1export const OPENVIDEOPLUGIN_REGEX = /^https?:\/\/[\w.-]+\/.+(video|v|playlist)\/[\w-]+([\?&][\w-]+=[\w-]*)*$/;
    22export const OPENVIDEOPLUGIN_OEMBED_BASE = "https://www.open.video/openvideo/oembed?url=";
    33export const OPENVIDEOPLUGIN_GENERATE_EMBED_CODE_BASE = "https://www.open.video/generate-embed-code?j=";
  • open-video/trunk/open-video-block/src/edit.js

    r3320896 r3327829  
    111111    const [ errorPosts, setErrorPosts ] = useState(0);
    112112    const [ propagateProgress, setPropagateProgress ] = useState(0);
     113    const [ isEmbedReady, setIsEmbedReady ] = useState(false);
    113114
    114115    const isValidConfig = () => {
     
    120121    }
    121122
    122     const [ blockMode, setBlockMode ] = useState( isValidConfig() ? PREVIEW_BLOCK_MODE : EDIT_BLOCK_MODE);
     123    const [ blockMode, setBlockMode ] = useState(EDIT_BLOCK_MODE);
    123124
    124125    const ALIGNMENT_CONTROLS = ["left", "center", "right"];
     
    162163        if (isValidUrl(embedURL)) {
    163164            fetchOEmbedHTML();
     165        } else {
     166            setIsEmbedReady(false);
    164167        }
    165168    }, [embedURL]);
     
    302305            requestURL = generatePlaylistURL(OPENVIDEOPLUGIN_GENERATE_EMBED_CODE_BASE);
    303306            if (!requestURL) {
     307                setIsEmbedReady(false);
    304308                return;
    305309            }
     
    308312            requestURL = generateSingleVideoURL(OPENVIDEOPLUGIN_OEMBED_BASE);
    309313            if (!requestURL) {
     314                setIsEmbedReady(false);
    310315                return;
    311316            }
    312317        } else {
     318            setIsEmbedReady(false);
    313319            return;
    314320        }
     
    333339                setAttributes({providerSlug: "Open.Video"});
    334340            }
    335         }
    336 
     341            setIsEmbedReady(true);
     342        } else {
     343            setIsEmbedReady(false);
     344        }
    337345    }
    338346
     
    685693                    )}
    686694                    <div class="openvideoplugin-btn-group">
    687                         <button onClick={showPreview} disabled={!isValidConfig()}>
     695                        <button onClick={showPreview} disabled={!isEmbedReady}>
    688696                            Done
    689697                        </button>
    690                         <button onClick={showAddToPosts} disabled={!isValidConfig()}>
     698                        <button onClick={showAddToPosts} disabled={!isEmbedReady}>
    691699                            Done & Add to Other Posts
    692700                        </button>
  • open-video/trunk/open-video.php

    r3326432 r3327829  
    1616 *
    1717 * @link              https://www.open.video/
    18  * @since             1.0.4
     18 * @since             1.1.0
    1919 * @package           Open.Video
    2020 *
     
    2323 * Plugin URI:        https://wordpress.org/plugins/open-video
    2424 * Description:       Open.Video allows you to easily embed videos to your site from the Open.Video Network.
    25  * Version:           1.0.4
     25 * Version:           1.1.0
    2626 * Requires at least: 6.1
    2727 * Requires PHP: 7.0
     
    4141 * Rename this for your plugin and update it as you release new versions.
    4242 */
    43 define('OPENVIDEOPLUGIN_VERSION', '1.0.4');
     43define('OPENVIDEOPLUGIN_VERSION', '1.1.0');
    4444
    4545global $openvideoplugin_regex;
Note: See TracChangeset for help on using the changeset viewer.