Bypass Form/auto submit on Video Uploads.

Here is a request that I have received that we can all kick around for an answer.  I have been requested that for video uploads that the form that comes up with the Title and Description, etc, be auto-submitted or bypassed.  They want members to be able to start their videos uploads and then the members can edit the title and description later if they wish, in other words, when uploading a video, the upload will accept the default values and never present the form at all.  Since videos may be large in size, the member will encounter long upload times; which is true, it takes time to upload a huge video file to be process and that time is dependent on your upload speed from your ISP.  They feel that this will make the video upload process less interactive; start your uploads, go to bed, and in the morning they will be on the site.

Now, as everyone that knows Dolphin knows that the uploader is shared among the modules, the form is shared among the modules and the edit form in the view page, the pop-up form, is shared as well, it comes from the BxDolFilesModule.php.  There is also javascript/jquery involved as well to slide the form in.  Any ideas on this one folks?

Geeks, making the world a better place
Quote · 12 Dec 2013

On earlier versions we had a external uploader (mass uploader) for this exact purpose.

I had one for OSX, and Linux/Unix - was working on a windows port, but got bored and never completed.

(what default values are you wanting it to adhere too ?) Video title ?

PixelSofa, Inc. - a fresh view of the web - www.pixelsofa.com
Quote · 12 Dec 2013

Yes, an offsite loader came to mind but it has to start the video processing.  The idea is that the form is never presented to the user, the title of the video is already automatically taken from the file name.

Geeks, making the world a better place
Quote · 12 Dec 2013

 

Yes, an offsite loader came to mind but it has to start the video processing.  The idea is that the form is never presented to the user, the title of the video is already automatically taken from the file name.

 yes of course, it would just be a seperate process that starts the encoding process and then injects into the database etc. 

I separate tool (if you would) that would just ask for username/password and then batch upload.

(I can map it out later when I am back at office)

PixelSofa, Inc. - a fresh view of the web - www.pixelsofa.com
Quote · 12 Dec 2013

The edit form is added after each upload using jquery/javascript.  The solution would be to see how and have it to not add the form since it is actually a post processing form to change the file information; that is if it works the same way for videos as it does for photos.

Geeks, making the world a better place
Quote · 13 Dec 2013

Something else you may want to check out is: If you chose to somehow bypass the video details screen, you would need to make sure that any 'required' boxes get modified to not be required. Also, you may want to try and upload 2 videos with the same exact name to make sure there will not be any conflicts if by some chance 2 separate members upload videos are identical. I think its based off of IDs and not the names, but doesn't hurt to check it out.

Nothing to see here
Quote · 13 Dec 2013

 

Something else you may want to check out is: If you chose to somehow bypass the video details screen, you would need to make sure that any 'required' boxes get modified to not be required. Also, you may want to try and upload 2 videos with the same exact name to make sure there will not be any conflicts if by some chance 2 separate members upload videos are identical. I think its based off of IDs and not the names, but doesn't hurt to check it out.

If you recall, in 7.1.4 after a lot of complaints, the title is the only default field, not even categories have to be filled in.  Plus, I think the same user can upload the same video twice with the same title.  From what I understand, linking to the files is done by the title and the title must be there or you don't have a link; well, the link is probably there but you have nothing to click on.

Of course I test such things on the test site first. 

Geeks, making the world a better place
Quote · 13 Dec 2013

if you bypass the form don't you think it will miss the Tags which will effect the search result ? It could be like youtube if u start uploading the file u can also fill the form in the same time n let the video upload n processed. As far i have seen those videos which are upload without filling the details never show up in the outline. so some time if this happens i have to upload the video again :/

Umar Haroon
Quote · 13 Dec 2013

One more thing if you bypass form and by chance  too many or too large videos are being uploaded. then don't you think it will put burden on server to process them n it will result in too many Failed videos

Umar Haroon
Quote · 13 Dec 2013

The idea is that the member can edit the details later if need be.  I really don't think it is that bad to show the form.  If I have to start the video upload and then go cut the grass, I can click submit when I return.  The connection between the site and the location machine needs to be there.  If there was an offsite java uploader then that would be nice.  Choose the file, enter the details such as title and description and tags, and then get it all sent without having to be logged into the site.

Geeks, making the world a better place
Quote · 14 Dec 2013

 

Something else you may want to check out is: If you chose to somehow bypass the video details screen, you would need to make sure that any 'required' boxes get modified to not be required. Also, you may want to try and upload 2 videos with the same exact name to make sure there will not be any conflicts if by some chance 2 separate members upload videos are identical. I think its based off of IDs and not the names, but doesn't hurt to check it out.

 The uploaded files are attached to the user, by ID when the items are uploaded. (working on the test version now)

PixelSofa, Inc. - a fresh view of the web - www.pixelsofa.com
Quote · 14 Dec 2013

I have a couple of thoughts on this idea.

First off, from what I am understanding, you want to be able to upload a video, and then NOT have that stupid form to fill in after the video upload has completed. This functionality already exists in the Groups Module. When you are on a specific Group page, (provided you are allowed to upload videos) when you click Add Video, it is a simple form that has a  browse button in which you select the video you want to upload, enter a title name, and then click submit. Upon video upload completion, the page is then redirected back to that particular Group page.

 

So, with that in mind, lets work through the flow. FIrst, I am checking on the BxGroupsView page, to find the button for Add Video. Around line 90, there is this:

               'TitleUploadPhotos' => $this->_oMain->isAllowedUploadPhotos($this->aDataEntry) ? _t('_bx_groups_action_upload_photos') : '',


So, from here, I am checking in the sys_objects_actions table for the button code and found this url:

{BaseUri}upload_videos/{URI}

Looking at the structure of the url, I can tell that this is not an actual page, but instead an action (function), So I then searched the Groups module for any instances of function actionUploadVideo (I always leave off the s at the end of things). That led me to this on BxGroupsModule.php:

    function actionUploadVideos ($sUri)
    {
        parent::_actionUploadMedia ($sUri, 'isAllowedUploadVideos', 'videos', array ('videos_choice', 'videos_upload'), _t('_bx_groups_page_title_upload_videos'));
    }

Now, I have to find the parent function of _actionUploadMedia. This is most likely in one of the files in inc/classes or templates/base/scripts. So I search for this function.

I find this on BxDolTwigModule.php in the inc/classes folder:



    function _actionUploadMedia ($sUri, $sIsAllowedFuncName, $sMedia, $aMediaFields, $sTitle)
    {
        if (!($aDataEntry = $this->_preProductTabs($sUri, $sTitle)))
            return;

        if (!$this->$sIsAllowedFuncName($aDataEntry)) {
            $this->_oTemplate->displayAccessDenied ();
            return;
        }

        $this->_oTemplate->pageStart();

        $iEntryId = $aDataEntry[$this->_oDb->_sFieldId];

        bx_import ('FormUploadMedia', $this->_aModule);
        $sClass = $this->_aModule['class_prefix'] . 'FormUploadMedia';
        $oForm = new $sClass ($this, $aDataEntry[$this->_oDb->_sFieldAuthorId], $iEntryId, $aDataEntry, $sMedia, $aMediaFields);
        $oForm->initChecker($aDataEntry);

        if ($oForm->isSubmittedAndValid ()) {

            $oForm->processMedia($iEntryId, $this->_iProfileId);

            $this->$sIsAllowedFuncName($aDataEntry, true); // perform action

            header ('Location:' . BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aDataEntry[$this->_oDb->_sFieldUri]);
            exit;

         } else {

            echo $oForm->getCode ();

        }

        $this->_oTemplate->addCss ('main.css');
        $this->_oTemplate->addCss ('forms_extra.css');
        $this->_oTemplate->pageCode($sTitle);
    }

This function creates the form and does the submission of info to the function that handles the actual entry of information into the database, as well as what page to return to after successful submission.

 

SO - after dissecting an existing functionality, I believe that using the function and adjusting the variables will accomplish what you want.

That's one way to do it. Another would be to put together your own video upload process, but make sure you get the data entered into all of the specific fields throughout the various tables.

caredesign.net
Quote · 15 Dec 2013

 

 

Something else you may want to check out is: If you chose to somehow bypass the video details screen, you would need to make sure that any 'required' boxes get modified to not be required. Also, you may want to try and upload 2 videos with the same exact name to make sure there will not be any conflicts if by some chance 2 separate members upload videos are identical. I think its based off of IDs and not the names, but doesn't hurt to check it out.

 The uploaded files are attached to the user, by ID when the items are uploaded. (working on the test version now)

I look forward to seeing this; given the large file sizes with videos, it really needs to be so that one can upload without being connected to the site. 

Geeks, making the world a better place
Quote · 16 Dec 2013

Thanks Professor, I will look into what you have posted.  Thanks for taking the time to do the research on this.

Geeks, making the world a better place
Quote · 16 Dec 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.