geodesicsolutions-community / geocore-community

GeoCore Community, open source classifieds and auctions software
MIT License
9 stars 6 forks source link

Flash no longer supported - during checkout, when adding a youtube video #91

Closed jonyo closed 2 years ago

jonyo commented 2 years ago

Note that it is only when placing the listing, when viewing the listing it shows correctly.

It looks like this for me:

Screen Shot 2022-02-20 at 17 13 00
vicos59 commented 2 years ago

This is a good search string:

x-shockwave-flash

src\classes\order_items\offsite_videos.php

src\classes\php5_classes\swift5\mime_types.php

src\admin\templates\listing_details\offsite_videos.tpl

src\js\plupload\plupload.full.min.js

vicos59 commented 2 years ago

I'll take a stab at this one. There only appears to be one supported YouTube embed method and that is via an iFrame.

<iframe width="560" height="315" src="https://www.youtube.com/embed/VBmCJEehYtU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

How do we handle these minified files?

src\js\plupload\plupload.full.min.js

Just reformat them so they can be reviewed/edited.

vicos59 commented 2 years ago

I'll be placing notes here for future reference.

geo_templates\default\system\listing_details\offsite_videos_block.tpl

This template displays the videos in the detailed view of the listing that the world sees. It works as-is. However, the params and attributes in the iFrame call may need to be updated to reflect current YT standard.

<iframe src='//www.youtube.com/embed/{$video.video_id|escape}?wmode=transparent' frameborder='0' wmode="opaque" allowfullscreen></iframe>

jonyo commented 2 years ago

I'll take a stab at this one. There only appears to be one supported YouTube embed method and that is via an iFrame.

<iframe width="560" height="315" src="https://www.youtube.com/embed/VBmCJEehYtU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

How do we handle these minified files?

src\js\plupload\plupload.full.min.js

That one in particular is a library, so update to the latest version if possible. I kind of remember that one may have been a purchased license, so not sure if that is possible...

In this case it is a thing that detects what is in the browser, if the browser is html5 then it uses that so it would never "use" the flash stuff since most visitors will be using a modern html5 browser.

jonyo commented 2 years ago

I stand corrected, maybe or maybe not they had a paid version, but they have open source versions now: https://www.plupload.com/download/

So that one should probably be done in its own task, to update that library (and use a package manager if possible, like npm or something).

edit: Looking closer, probably they paid for the OEM version since the "free" one technically cannot be in commercial products. Now that GeoCore is released under MIT license we should be fine to use the "free" version.

vicos59 commented 2 years ago

geo_templates\default\system\order_items\offsite_videos\upload_slot.tpl

This is the template the user sees when he specifies a YT video to be included with his listing during initial post or subsequent edit.

There is also an applicable css file:

geo_templates\default\external\css\default.css

--> div.preview_offsite_video_box

vicos59 commented 2 years ago

So that one should probably be done in its own task, to update that library (and use a package manager if possible, like npm or something).

Agree, package managers are currently beyond my skillset.

jonyo commented 2 years ago

So that one should probably be done in its own task, to update that library (and use a package manager if possible, like npm or something).

Agree, package managers are currently beyond my skillset.

The first one will take some work to get npm set up for the first time, making it build correctly and all that. Once it is there it should be easy-ish to add / update new packages.

vicos59 commented 2 years ago

@jonyo This looks like old version control stuff at the top of some files:

{ 6.0.7-3-gce41f93 }

Zap it?

vicos59 commented 2 years ago

Embedded YouTube Player size

Embedded players must have a viewport that is at least 200px by 200px. If the player displays controls, it must be large enough to fully display the controls without shrinking the viewport below the minimum size. We recommend 16:9 players be at least 480 pixels wide and 270 pixels tall.

https://developers.google.com/youtube/terms/required-minimum-functionality#:~:text=YouTube%20audiovisual%20content.-,Embedded%20YouTube%20Player%20size,wide%20and%20270%20pixels%20tall.

vicos59 commented 2 years ago

src\admin\templates\listing_details\offsite_videos.tpl

is called by:

admin\templates\listing_details\index.tpl

Noted so I can focus testing proper place.

jonyo commented 2 years ago

@jonyo This looks like old version control stuff at the top of some files:

{ 6.0.7-3-gce41f93 }

Zap it?

Yup! That is from back when we used svn, they had an easy way to replace a thing with the svn info.

It sort of had a way to do it in git but it was kinda hacky IIRC. And now we are not using the internal build tools to generate the end files, so they are not updated at all.

Feel free to delete them when you are working on a file. Or delete all of them if you feel so inclined (dedicated a PR just to that).