jeudi 1 avril 2021

Looking for HTML5 code etc to enable user to select different audio tracks to play with video

I have a project I'm working on in HTML5 java script and css. It is designed to be wrapped up into a stand alone mobile phone app. I studied coding in various formats over 20 years ago and built multimedia websites for clients. How things have changed........in a good way on the functionality side of things with HTML5 etc

Basically the app enables a user to select a video and can also select up to 4 different background audio files to play in sync with the video. If it is possible to select different up to 4 video backgrounds to play behind the main video as well, would be a bonus. All the videos I have created are produced with an alpha channel. There are 11 individual videos the user can select from.

To keep the file sizes small all the videos are all 6 seconds in duration in Mp4. The audio tracks sounds are Mp3's. The video and audio will need to loop in sync continuously until the user stops the play.

I have spent a good deal of time looking for appropriate code that will enable this process to happen, but have had no success. I have found snippets on this site for looping and controlling video etc, that I have experimented with but implementing the audio and video background user select functions has escaped me.

I am hoping that one or more of you good folks on this site can assist me with producing this code and providing any additional thoughts and suggestions that could be useful for my project.

Many thanks in advance Michael




How to get equivalent from Java script for SHA1

I am trying to get the equivalent output from java script for SHA1. My java code is given below.

String password = "nuwanw321nuwanw";
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(password.getBytes());
System.out.println(( new BASE64Encoder() ).encode( md.digest() ));

It produce output as :- akIlJ5aXznl4f6mmGThlhkRn5UY= What is the correct way to get the same from java script.

Thanks




change website doc root location in Apache24 config on FreeBSD

I wish to re-direct the default index.html file for apache24 config on FreeBSD :

from - /usr/local/www/apache24/data/index.html

It works!

To - /var/www/index.html (with different index.html with support files for single page, static website)




pdf disappear after click button

I am wanting to make a webpage to translate, with pdf shown on the left, I can get the pdf to show now and the textarea on the right, but when I press the translate button on the left, it disappears. I would like to get a solution, please advise me to write it in php and html.




I want to update jwt token with login time in codeigniter

I want to update jwt token on time of login and set that jwt token into my database user's table. I hope You will definitely help me out with that. Thanks

this is my user controller

public function canLogin()
    {
        $method = $_SERVER['REQUEST_METHOD'];
        if ($method == 'GET') {
            json_output(404, array('message' => 'Method must be a POST'));
        } else {
            $params = (array) json_decode(file_get_contents('php://input'), true);
            $email = $params['email'];
            $password = $params['password'];
            // $tokenData = $this->authorization_token->generateToken($email, $password);
            // $final = array();
            // $final['token'] = $tokenData;
            // json_output(200, array('code' => 200, 'data' => $final));
            if ($email && $password == true) {
                $data = $this->Users_Model->canLogin($email);
                if ($data != null) {
                    $check_password = password_verify($password, $data[0]['password']);
                    if ($check_password) {
                        json_output(200, array('code' => 200, 'message' => "Successfully Login", "data" => $data));
                    } else {
                        json_output(200, array('code' => 400, 'message' => "Invalid Password"));
                    }
                } else {
                    json_output(200, array('code' => 400, 'message' => "Email not Found"));
                }
            } else {
                json_output(200, array('code' => 400, 'message' => "Email or Password Shouldn't be null"));
            }
        }
    }

this is my user model function:

public function canLogin($email)
    {
        $this->db->select('*');
        $this->db->where('email', $email);
        // $query  =   $this->db->get($this->users);
        $query = $this->db->get('users');
        // $row = $query->row();
        return $query->result_array();



Turn spreadsheet into web page for multiple users simultaneously

I have created an excel spreadsheet with many calculations depending on number that a user inserts in every row. I would like to turn it into web page so multiple users could access it simultaneously. I believe I can't do it with MySQL, because, although it supports multiple users, it can't use all of the functions that already exist in the spreadsheet. Those functions and calculations depend on value cells of not only the active row, but previous and next rows also. I don't want to use (free-trial or free) applications and programs that convert it in minutes to web page, but I would like to do it all by myself. Which programming language is the best? I repeat that the goal is to be used by multiple users. Thanks in advance




Regex breaking with some wildcard characters [duplicate]

I am currently working on a search feature where I would like to use some text highlighter approach whenever the user types in a keyword. Here's the code that I have come up with for the same:

const regex = new RegExp(`(${highlight})`, 'i'); // highlight here would be the entered keyword
const parts = searchLabel.split(regex); // splitting the result for proper highlighting

It works mostly well, but starts breaking when user enters * or ( or ).

Here's the error with (:

Highlighter.js:29 Uncaught SyntaxError: Invalid regular expression: /())/: Unmatched ')'

or with *

Uncaught SyntaxError: Invalid regular expression: /(*)/: Nothing to repeat

It might be because I am not escaping them properly but I would like the user to search by any keyword. Is there a way to get around this? I know this must be trivial to a lot of folks but I am a complete noob when it comes to regex.

Any help is appreicated.