Fieldtype, Module, Plugin

Archived
Forum
(read-only)

Video Player

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Benjamin David

1 of 2
1
   

Video Browser doesn’t appear

Support Request

Boulevards
Boulevards

Hello,

We need your assistance.  The video browser/selector doesn’t appear after “+ Add Video” is clicked (see attached)

Steps to reproduce:

1. Login to CP
2. Navigate to “Publish” a new entry
3. Click “+ Add Video” link

Result:

The translucent black background overlays the site but no video browser/selector appears (see attached)

Expected Result:

A popup browser to appear so i can search or input a video source.

Things I noticed:

1. The form it’s requesting, via AJAX, exists.   When i go to http://www.mysite.com:8585/?ACT=100&method=box, I get:

<div id="videoplayer-box">
    <
div id="videoplayer-preview" class="play"></div>

    <
div id="videoplayer-content">

        <
div id="videoplayer-form-search">
    <
div id="videoplayer-search">
        <
input type="text" name="" value="" class="videoplayer-text" rel="http://www.mysite.com:8585/?ACT=100&method=search"  />    </div>
    
    <
div id="videoplayer-filters">
        <
ul>

            <
li class="videoplayer-filter-label">Filter &raquo;</li>
            <
li class="selected"><a href="#" rel="youtube"><img src="https://cms.mysite.com:4479/themes/third_party/videoplayer/service-youtube.png" />YouTube</a></li>
            <
li><a href="#" rel="vimeo"><img src="https://cms.mysite.com:4479/themes/third_party/videoplayer/service-vimeo.png" />Vimeo</a></li>
        </
ul>
        <
div class="videoplayer-clear"></div>
    </
div>
    
    <
div id="videoplayer-search-results">

        <
class="no-videos">No videos to display</p>
    </
div>
</
div>
    </
div>
    
    <
div id="videoplayer-controls">
        <
p>
            <
label>Video URL</label>
            <
input type="text" name="" value="" class="videoplayer-text" rel="http://www.mysite.com:8585/?ACT=100&method=search"  />        </p>

        <
p id="videoplayer-submit"><a id="videoplayer-btn-cancel" href="#" class="videoplayer-ui-btn">Cancel</a> <a id="videoplayer-btn-use-video" href="#" class="videoplayer-ui-btn videoplayer-ui-btn-pink">Use this video</a></p>
    </
div>
</
div

Though it appears that within your “videoplayer_box_overlay()” function in “themes/third_party/videoplayer/videoplayer.js”, the “data” variable, within the ajax “success” callback, is empty.

2. The boxUrl value doesn’t seem to be the issue ,  because I have replaced with http://www.google.com

Whats going on here?

Benjamin David
# 1
Developer
Benjamin David

Hi there,

There’s a upcoming update coming soon fixing an issue with Video Player calling wrong URLs with AJAX and I think it might fix your issue. Could you please give me more informations though, just to be sure it’s not a new different bug before we release Video Player 2.4.1 :

- a copy of your phpinfo() in order to check that your server PHP config is ok
- seems like you’ve already done some testing regarding the AJAX call. You got these results from Firebug right ? Are there any other Javascript errors ?

Also, if you’re OK to give me an access to your Control Panel, it would help a lot fix your problem faster.

Sorry for the matter, I’ll do my best to fix your issue as quickly as possible !

Boulevards
# 2
Boulevards

Thanks for the quick response. We isolated the issue.

Solution

Use the CP url, not the site url for ajax get requests

Background

We have our development EE2 CP on a certified password protected domain like:
* https://ee2.cmsdomain.com:4449

But our development sites are like
* http://www.mysite.com:8080
* http://www.mysite2.com:8080

They way you have it set up, requests a response from mysite.com, producing a cross domain error.  Or as Google Chrome likes to put it:
“XMLHttpRequest cannot load http://www.mysite.com:8080/?ACT=100&method=search&q=on ap. Origin https://ee2.cmsdomain.com:4449 is not allowed by Access-Control-Allow-Origin.”

So the only way it worked was by requesting:
* https://ee2.cmsdomain.com:4449/?ACT=100&method=search&q=on ap

instead of:
* http://www.mysite,com:8080/?ACT=100&method=search&q=on ap

When will 2.4.1 be released?  This hack isn’t fit for production.

Benjamin David
# 3
Developer
Benjamin David

Hi,

Video Player 2.4.1 has been released but I’m not sure it will fix this problem. We make Ajax calls to the control panel in order to show the Video Player lightbox and to run search queries.

Javascript restricts Ajax calls to be made on the same domain & port otherwise it will throw a cross-domain error (the one you’re getting). This is not really a bug in the Video Player add-on but more a Javascript restriction.

Boulevards
# 4
Boulevards

If you’re making calls to the CP instead of the site URL we may be on the same page, but I’m having trouble downloading.

Boulevards
# 5
Boulevards

Cool we did the update though the problem still persists.  I think, at this point, all you need is to change the AJAX request URLs from the site URL to the control panel URL.  So in the <head> of the “Publish Form” it says:

[script type="text/javascript"]    
    
var VideoPlayer VideoPlayer VideoPlayer : new Object();
    
VideoPlayer.xid '{XID_HASH}';
    
VideoPlayer.box_ajax_url 'http://www.mysite.com:8080/?ACT=101&method=box';
    
VideoPlayer.search_ajax_url 'http://www.mysite.com:8080/?ACT=101&method=search';
    
VideoPlayer.video_ajax_url 'http://www.mysite.com:8080/?ACT=101&method=video';
[/script] 

And we need it to say:

[script type="text/javascript"]    
    
var VideoPlayer VideoPlayer VideoPlayer : new Object();
    
VideoPlayer.xid '{XID_HASH}';
    
VideoPlayer.box_ajax_url 'https://www.controlpanel.com:4479/?ACT=101&method=box';
    
VideoPlayer.search_ajax_url 'https://www.controlpanel.com:4479/?ACT=101&method=search';
    
VideoPlayer.video_ajax_url 'https://www.controlpanel.com:4479/?ACT=101&method=video';
[/script] 

Note that we use “Multi Site Manager” so the control panel is on URL “https://www.controlpanel.com:4479” and the site is on URL “http://www.mysite.com:8080”.  Would Duktee be willing to make the change?

Note that we have also hard coded this URL change in your Videoplayer_lib::ajax_action_url() method, and confirmed that it works just fine.  Clever add-on btw.

Boulevards
# 6
Boulevards

Is there an area where I can submit this as a formal request?  I need to know if we will be able to use this add-on or not.

Richard Wiggins
# 7
Richard Wiggins

I appear to be having the same issue regarding when clicking to add a video. I also get a translucent black background overlays the site but no video browser/selector appears.

I have literally just purchased this plugin and now can’t seem to use it.

Is there a fix for this yet?

Benjamin David
# 8
Developer
Benjamin David

There has been some follow up by email with some people in this thread, here is what we ended with :

- First of all, if your front-end and control panel are on the same port, you might be having another problem which is not related to this thread, please get in touch with us so we can help you : support@duktee.com

- There is a Javascript restriction that disallows Video Player from making Ajax Request on differents ports (4479 vs 8080 for example). Javascript considers different ports the same way it considers different domain calls : a cross scripting security issue, preventing from making ajax calls. This is not really a bug in the add-on but more a Javascript restriction.

- We are investigating another way to bypass this problem. We still have some testing to do to see how feasible this is, but we’ll get back on this as soon as possible next week to tell you more about how we will handle this issue.

If you’re having this issue, please get in touch with us (support@duktee.com) to describe as much as possible your situation (configuration, PHP/Apache versions, phpinfo()) and we’ll do our best to help you.

Kind regards

Benjamin David
# 9
Developer
Benjamin David

We’ve been abled to run to tests we needed to do and I’m happy to tell you that we will be fixing this issue soon. We need to rewrite some come in order to make AJAX calls happen in another way and we’ll be releasing it next week.

Sorry for the matter, I’m keeping you posted for the bug fix release.

Benjamin David
# 10
Developer
Benjamin David

The one limitation with the new method is that when in the control panel, member groups would have to be allowed to access the module which is currently not the case as for now you just need to setup a Fieldtype to make it work.

Is this an issue for you ?

Boulevards
# 11
Boulevards

Thanks, for the support.  Sounds great.  Permission restrictions not preferable but not a problem for us.

Benjamin David
# 12
Developer
Benjamin David

Hi there,

Just wanted to tell you that I didn’t forget you. It’s taking more time than expected but we did find a way to solve this problem without the need of a module workaround. So you won’t have to give specific permissions to people in order to make the add-on work.

Posting the fix as soon a possible.

Boulevards
# 13
Boulevards

We appreciate the beta fix.  Works great so far.  Thanks!

Hambo
# 14
Hambo

We can’t search videos in 2.5 either. Anything we can do?

Benjamin David
# 15
Developer
Benjamin David

Hi,

I would need a bit more information in order to help you :
- Do you get the lightbox window coming up ?
- Can you please copy paste javascript errors from firebug ?
- Are you using MSM ?
- Did you rename the EE index.php ?
- Can you send us your phpinfo() ?

I can also help you faster if you’re OK to give me login infos to your Control Panel.

Remaining at your disposal if you have any questions.

Kind regards,

Ben

1 of 2
1