小编Xi *_*iao的帖子

如何为 html5 视频加载 vtt 文件启用 CORS?

我的需要

html5 video 元素加载保存在不同域中的视频和 vtt 文件。

问题

vtt 未加载和错误 Text track from origin has been blocked from loading: Not at same origin as the document, and parent of track element does not have a 'crossorigin' attribute.

我的调查

我知道需要使用 CORS,以便 vtt 可以成功加载到 html5 中。

我已经在服务器端为来自任何域的请求启用了 CORS。

一些文章说添加crossorigin或添加crossorigin="anonymous"到` 元素可以完成这项工作,但它不起作用。视频根本没有加载或出现不同的错误

我把我的代码放在下面

<body>
  <div class="container">
    <video id="myvideo" controls preload="auto" width="640" height="264" autoplay>
      <source src=http://video.dublearn.net/-KqIgE-3roMSBbiHUmLI/video.mp4 type="video/mp4"></source>
      <track kind="captions" label="English" srclang="en" src=http://video.dublearn.net/-KqIgE-3roMSBbiHUmLI/video.vtt default>
    </video>
</body>
Run Code Online (Sandbox Code Playgroud)

html5-video vtt webvtt

7
推荐指数
2
解决办法
4042
查看次数

ffmpeg - 如何将多个音频与时间偏移合并到视频中?

我想使用FFMPEG来传输多个音频和一个视频.

材料是:

  1. 两个短音频片段(短片-1.3gp,短片-2.3gp),
  2. 一个带声音的视频片段(1.mp4),
  3. 和一个与视频剪辑具有相同持续时间的音频剪辑(1.mp3).

要求是:

  1. 删除视频剪辑的声音
  2. 添加1.mp3
  3. 在0秒时间戳添加短剪辑1.3gp,在10秒时间戳添加短剪辑2.3gp.

要求如下所示.

< - short-clip-1.3gp持续时间 - > < - short-clip-2.3gp持续时间 - >

<-------------------------------------- 1.mp3 -------- --------------------------------------------->

<-------------------------------------- 1.mp4 -------- --------------------------------------------->

我使用的命令如下,但它不能按预期工作. ffmpeg -i 1.mp4 -i 1.3gp -itsoffset 00:00:10 -i 2.3gp -i 1.mp3 -map 0:v -map 1:a -map 2:a -map 3:a -c:v copy -c:a copy result.mp4

任何提示都表示赞赏!

ffmpeg

4
推荐指数
2
解决办法
2794
查看次数

从 nodejs 中的 vtt 文件中获取所有提示及其属性

说,我有一个 vtt 文件,我想从中获取 nodejs 环境中的所有提示及其相关属性,例如 startTime、endTime 等。

我已经搜索了所有我能想到的关键字,比如'parse vtt file by javascript',但结果都是关于mozilla/vtt.js。但是我不需要与浏览器/窗口交互,它只是一个静态的 vtt 文件,我需要通过 JavaScript 从中提取数据。

有人能给我一些提示吗?谢谢!

示例 vtt 内容:

WEBVTT FILE

1
00:00:03.500 --> 00:00:05.000 D:vertical A:start
Everyone wants the most from life

2
00:00:06.000 --> 00:00:09.000 A:start
Like internet experiences that are rich <b>and</b> entertaining

3
00:00:11.000 --> 00:00:14.000 A:end
Phone conversations where people truly <c.highlight>connect</c>

4
00:00:14.500 --> 00:00:18.000
Your favourite TV programmes ready to watch at the touch of a button

5
00:00:19.000 --> …
Run Code Online (Sandbox Code Playgroud)

javascript node.js vtt webvtt

3
推荐指数
1
解决办法
914
查看次数

如何在 Firebase 中检索其他用户的信息,如电子邮件和显示名称?

users在 Firebase 中有一个节点,用于存储每个用户的信息,但不包括 displayName andfirebase auth 数据库中的 email`。

有一天,我意识到我也需要用户displayNameemail信息。例如,在另一个用户创建的页面中,我想显示该用户的 displayName 和电子邮件。

鉴于

  1. displayName并且email不存储在users节点下,
  2. 用户的 uniqueId 已知

是否可以从 firebase auth 数据库(普通用户或管理员)检索用户的displayNameemail?或者我应该为已经在 firebase 中创建的用户做什么?

感谢:D

firebase firebase-authentication firebase-realtime-database

3
推荐指数
1
解决办法
1550
查看次数

C# 通过 System.DirectoryServices.AccountManagement 访问 msExchRecipientTypeDetails 属性

我使用下面的代码片段System.DirectoryServices.AccountManagement在 ActiveDirectory 中搜索用户。

user.Name成功返回,但我怎么能检索其他属性从AD用户,喜欢msExchRecipientTypeDetails,因为它不是在VisualStudio中2015年的情报显示?

using (PrincipalContext adPrincipalContext = new PrincipalContext(ContextType.Domain, DOMAIN, USERNAME, PASSWORD))
{
    UserPrincipal userPrincipal = new UserPrincipal(adPrincipalContext);                
    userPrincipal.SamAccountName = "user-ID";   
    PrincipalSearcher search = new PrincipalSearcher(userPrincipal);

    foreach (var user in search.FindAll())
    {
        Console.WriteLine("hei " + user.Name);         
        // how to retrive other properties from AD like msExchRecipientTypeDetails??          
    }
}
Run Code Online (Sandbox Code Playgroud)

c# active-directory

1
推荐指数
1
解决办法
771
查看次数