• Hello
    I just started learning how to work with WordPress and its capabilities.
    I need to implement something and I will appreciate any advice on what is the best way to do it.
    Our current website (written in php but not wordpress) is mainly about watching video files (lectures). We have hundreds of them on our server and they are big (each around 80 MB). The user can filter the videos, and select one (clicking on a link). he then redirected to a page with a video player on it. This page gets a parameter that tells which src file to play.
    Now, I am about to create our website from scratch and intended to use wordpress. I see 3 options for implementing this:

    1. Find a plugin that already does all this (I need a miracle).
    2. Go with the same idea of one page that gets a parameter with the src file location.
    in this case it looks like I will have to write a custom php code for this.
    3. find a way to upload all this big video files to wordpress, somehow automatically
    create a post for each of them, and then I will have a regular blog with video
    posts. (afterwords it will be easy to add new posts for new videos)

    Is there a better way to do it? If not, which one is possible with wordpress and how to do it?

    Thank you

    • This topic was modified 6 years, 10 months ago by talia1601.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    If you are going to use WP, you should setup media file references the way WP would normally do it. Then the scheme will be consistent with newly added media and some query will yield results from old and new media together with no special coding. If your video files are already on the server that will run WP, there’s no need to upload them again. You will just add references to them in WP so WP can find them.

    Do these files have any sort of meta data associated with them? It would be very useful because a one time import script could be created that adds the necessary WP references and data. Even if not, it may be worth creating the data and writing the import script. It would possibly be easier than manually creating the references, and certainly less error prone.

    After a fresh WP install is made, upload a video file to WP so a model exists for what the import script needs to replicate. Every media file in WP is associated with an attachment post type. These attachments are typically children of blog posts (post post type), but it is not a requirement. Requests and searches in WP are typically for blog posts, not attachments, but almost any scenario can be accommodated with some custom coding. The attachment will also have various data related to the file in the post meta table. Your import script would need to create this data as well. Depending on the PHP function used to add attachment posts, this might be done automatically. Lower level functions will require the script to do this. Any additional meta data could go in the post meta as well.

    The video files can work in their current location, but for consistency, it’d be a good idea to move them to /wp-content/uploads/. In ‘nix O/S, you don’t actually want to ‘move’ them, instead use rename to alter the path. Rename will run much faster since the files remain where they physically are on discs, only the path reference in the indexes is changed.

Viewing 1 replies (of 1 total)
  • The topic ‘video with dynamic src’ is closed to new replies.