P
P
pavelmosin2022-01-18 11:42:17
1C-Bitrix
pavelmosin, 2022-01-18 11:42:17

What is the easiest way to display video on the site through files?

Good afternoon!
Bitrix IM + 1s.
Videos for products are now displayed through YouTube.
The client wants to output video via .mp4 files, as it is done, for example, on WildBerries
It is clear that this can be done by uploading files manually to the server, but the client does not really want to do it on his own, and adding a file through the site admin panel takes a long time - there are a lot of goods .
Is there any way to make this easier and more convenient?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2022-01-18
@Tomio

Maybe it's worth trying to write a script that will distill videos from Youtube into an mp4 file on the server with the site?
The algorithm is something like this:
1 - Create a new field with the "File" type for the video
2 - Write a script in which:
2.1 - The selection of catalog elements with a link to the video in Youtube is made (we pull out only the element ID and the link to the video)
2.2 - We go through for each element, download the video to a folder on the server using the link and write down the path to it. After uploading, we attach the video to the element by the element ID and the ID of the newly created property from paragraph 1
2.3 - Update the element
3 - Make changes in the public part of the site. Check if the element has a new property from item 1 filled in, then output the downloaded video from the server. Otherwise display video from Youtube.
I did not describe the technical side in detail, because the implementation may be different. The first thing you will need to win is downloading videos from Youtube. Google on this topic, php has libraries for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question