[Self-study notes] The video tag cannot play the video on the server

The actual project, write an H5 user sharing page

A multimedia carousel, you can watch pictures and videos uploaded by users.

When the page is actually uploaded to the server to run, something goes wrong.

The pictures are all fine, but the video files cannot be played.

Find out why,

When developing locally, the file path src is generally **.jpg or video file **.mp4 for testing. If such a path is placed on the server, there is no problem in reading the server file.

After understanding the background processing, I found that the file stored in the cloud has no suffix name given to the address! ! !

Local files can't be played without a suffix, but it is actually playable by placing the path alone at this address.

This makes me very suspicious of life.

Baidu searched and found that angular was at faultget angryget angryget angry

Add the main site name to the whitelist

angular.module('share', []).config(function($sceDelegateProvider) {
        $sceDelegateProvider.resourceUrlWhitelist([
            'self',
            //whitelist
            'http://www.xxxx.com/**'
        ]);
    })

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324677090&siteId=291194637