media – How do I create a video embed text filter?


How can I make a filter to get an ID video from a link like the following?

{"preview_thumbnail":"/sites/default/files/styles/video_embed_wysiwyg_preview/public/video_thumbnails/J5LdiPsQ-wOVdt6af.jpg?itok=1MWpCCDv","video_url":"https://content.jwplatform.com/videos/J5LdiPsQ-wOVdt6af.mp4","settings":{"responsive":1,"width":"854","height":"480","autoplay":0},"settings_summary":("Embedded Video (Responsive).")}

I need to replace preview_thumbnail with the following code.

(
  '#type' => 'pattern',
  '#id' => 'video_block',
  '#fields' => (
    'video_id' => $media_id,
    'video_type' => 'jwplayer',
  ),
);

I should also replace $media_id with J5LdiPsQ-wOVdt6af.mp4.