I have a content type video with a File field (field type "File" and Widget "Media file selector"). When I go to upload a video (Select media button), select the video or paste a YouTube video, and click Submit, I get the error:

TypeError: this.contentWindow.Drupal is undefined
if (this.contentWindow.Drupal.media.browser.selectedMedia.length > 0) {

Anybody have an idea how to fix this issue? Also, when I go to edit Content that is of type Video, it just shows a blank page. No idea what is going on.

CommentFileSizeAuthor
#5 type_error-1960438-4.patch2.14 KBmagi.yv
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

First.Middle.Last.1024’s picture

Here's what appears to happen:

I create a Content of type Video. It loads and then I hit "Select media". It opens a media popup, runs through media.popups.js fine. Once I paste in the YouTube URL and hit submit, the page reloads but on line 103 of media.popups.js,

this is: iframe#mediaBrowser.media-modal-frame
contentWindow is: Window browser?render=media-popup&fid=162
Drupal is: undefined

There is no popup window anymore but I do see the black overlay.

First.Middle.Last.1024’s picture

Also, if it is any help, when I first click on "Select media", the form action is:

/media/browser?render=media-popup&types%5Bimage%5D=image&types%5Bvideo%5D=video&activePlugins=&schemes%5Byoutube%5D=youtube&schemes%5Bpublic%5D=public&file_directory=videos&file_extensions=mv4+mp4+ogg+theora&max_filesize=&uri_scheme=public&plugins=undefined

blueyestar’s picture

Similar issue when I paste vimeo URL

magi.yv’s picture

Component: Media field » Code
Issue summary: View changes

Similar issue. When the pop-up loads getting error message
"TypeError: this.contentWindow.Drupal.media is undefined
if (this.contentWindow.Drupal.media.browser.selectedMedia.length > 0) { "

version : 7.x-1

magi.yv’s picture

FileSize
2.14 KB

This patch resolved my issue.

Chris Matthews’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Active » Closed (outdated)

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team

firewaller’s picture

Just for the record, this was happening for me after enabling Cloudflare CDN and I ended up fixing it by disabling the "Rocket Loader" feature.