You can inspire from this tutorial here:
http://www.sitepoint.com/adding-a-media-button-to-the-content-editor/
For videos you can change the library type to ‘video’:
function open_media_window() {
var window = wp.media({
title: 'Insert a media',
library: {type: 'video'},
multiple: false,
button: {text: 'Insert'}
});
}
Hope this helps.
Related Posts:
- WordPress 3.5 Media Manager – add a button
- Hook for image edit popup
- How to extend Media Library (WP 4.4)
- Upload images from custom plugin using the media modal
- WordPress 3.5 Media Manager – add a button
- Media upload not working on theme option in WordPress 3.8.1
- adding a button to the media uploader
- wp.media.view.ImageDetails – Save settings as HTML5 data-* attributes for image
- I Want to Get A Plugin Version Number Dynamically
- “Add Media” button in custom plugin
- Get a list of all WordPress.org Plugins?
- [Plugin WPML] : How to create a translation of a post using the WPML API?
- Remote upload file to server B
- What WordPress API function lists active/inactive plugins?
- What plugin can I use to create a list / slideshow of featured images?
- Change Page’s Tag Using functions.php File
- Upload specific images to specific folder
- How to build an API as a plugin
- Any plugin out there that uses WP’s internal image uploader?
- Get Latest Plugin Version from WP API
- Resizing all images
- How to make WordPress use protocol indepentent upload files?
- How should I use register_setting, add_settings_section, & add_settings_field in my plugin’s options page?
- How do I retrieve a list of popular plugins using the WordPress.org Plugin API?
- How to create an edit media button for slideshow plugin?
- Using the media uploader in a custom plugin
- Increase Size Limit of Media Files WordPress 4.1
- Using custom code, how can I fetch data from the WordPress plugin repo?
- Can’t use /wp-json/wp/v2/plugins API endpoint even as administrator
- Send Data to WordPress from kiosk
- Multisite functions to communicate with individual site functions
- Does the WordPress API have Modal Dialogs
- An Unexpected HTTP Error occurred during the API request
- Generated Images sizes do not match Media Settings Image Size
- REST-API: extend media-endpoint
- How to check if WordPress is updating plugins?
- Custom routing for plugins
- Advanced Integration – WordPress + YOURLS
- Get Plugin Information from Multiple Sites Externally
- What is the best way to move a plugin´s subdirectory+files to wp-content/uploads-directory?
- Create or Update thousands of woocommerce products via PHP
- Looking for a solution – slightly convoluted problem
- How do I create a full-bleed background image on text mouseover? [closed]
- Keep user’s privileges on accessing contents in JSON response
- How to import 55k images (uploaded via FTP) into WordPress Media libary? [closed]
- How can I serve a text file at a custom URL
- How to export a list of all media urls? [closed]
- Find unused images?
- Best way to hook a custom url?
- Lightbox Plus ColorBox plugin and auto playing YouTube video
- How can I add an options page for my class based plugin?
- Sending WP posts to external API
- add mediaelement.js plugins into WordPress video player control bar
- How to upload images to WP Panel keeping correct folder in FTP
- CMB2 Repeatable Group & JSON API
- WordPress JSON API remove posts from a specific category
- How to access data in wordpress database externally using php
- How organize uploaded media in WP?
- Media is not attached after import
- Plugin or method to delete uploads not in media library?
- Restrict media upload size by format
- WordPress: cleaning media library
- How to modify WCMP Rest API response?
- How to use JSON data from URL into table on my wordpress website
- wp_generate_attachment_metadata is creating an empty array
- wp_remote_get() returns 403 while file_get_contents() does not
- How to install/enable mediaelement.js plugins in WordPress
- Limit post creation by role
- How to upload WordPress Images to remote web server and display those images in WordPress gallery [closed]
- How to disable search as you type plugin suggestions?
- Set plugin-values when creating post via REST-API
- Auto move media file to cloud
- Retrieving Meta from Image Attachment
- WordPress does not show products when the value of post_parent is not 0
- media page returnig to 404 in rtmedia [closed]
- WordPress api call using wp-ajax returns error 400
- Fullscreen Video/GIF Intro
- WordPress stats API key
- Plugin is a widget, but I want to call it in the head, can I?
- Great blogs site resources/tutorial for WordPress Developers? [closed]
- Socialite WP plugin, unable to obtain API keys from FB
- How to pass the API key to the client from the database? [closed]
- Prevent plugin from intruding on wp-json posts api
- AJAX on Front-End Button Click not working – Custom Plugin
- Getting a Page via its post-name using WP REST API v2 and Postman
- MediaElement.js works on one site but not the other?
- How to set category correctly for a custom post created by a remote API call?
- Integrating boxtal PHP library into a custom WordPress Plugin
- Skewed / slanted button within elementor [closed]
- How to get theme’s info from wordpress.org/themes using api.wordpress.org?
- Custom API plugin to execute 3rd party API to retrieve data
- Opening a JQuery modal window on click of a button with a JQuery plugin
- How to Include Fields in Query String When Making Request of WordPress.org Plugin API?
- Sending customer an email with link to stripe to make payment
- Delete Media not attached with Any posts
- Api external with wordpress
- How to get a list of all the available plugins names
- How can ι create my own (custom) WordPress table/list?
- Convert to shortcode?
- Disable submit button order