svelte框架第三章详细教学

今天我们来认识一下,媒体有关的东西,比如说

<video
	src={clip}
	bind:duration
	bind:buffered
	bind:seekable
	bind:seeking
	bind:played
	bind:ended
	bind:currentTime
	bind:paused
	bind:volume
	bind:videoWidth
	bind:videoHeight
></video>

视频标签,这样吧,我们来做个小demo让大家理解这个视频的用处

但是你会神奇的发现,官网提供的标签是有问题的

我们需要到rollup.config.js中进行配置

svelte({

            // compilerOptions: {

            //  // enable run-time checks when not in production

            //  dev: !production

            // }

            onwarn:(warnig,handler)=>{

                if(warnig.code==='a11y-autofocus') return

                handler(warnig)

            }

        }),

 有的人可能配置了也会出问题,那就是说,依旧视频出问题,报错

<!-- svelte-ignore a11y-media-has-caption -->

或者说路径是正确的,但是视频没办法进行播放,这个是让人头痛的

 又或者你可以尝试匹配规则

{

            "rules": {

                "jsx-a11y/media-has-caption": [ 2, {

                    "audio": [ "Audio" ],

                    "video": [ "Video" ],

                    "track": [ "Track" ],

                  }],

            }

        },

原文说到:

Providing captions for media is essential for deaf users to follow along. Captions should be a transcription or translation of the dialogue, sound effects, relevant musical cues, and other relevant audio information. Not only is this important for accessibility, but can also be useful for all users in the case that the media is unavailable (similar to alt text on an image when an image is unable to load).

The captions should contain all important and relevant information to understand the corresponding media. This may mean that the captions are not a 1:1 mapping of the dialogue in the media content. However, captions are not necessary for video components with the muted attribute.

翻译后:

,为媒体提供字幕对聋人用户的理解至关重要。字幕应该是对白、音效、相关音乐线索和其他相关音频信息的转录或翻译。这不仅对可访问性很重要,而且在媒体不可用的情况下对所有用户都很有用(类似于图像无法加载时对图像的alt文本)。

标题应包含所有重要和相关的信息,以了解相应的媒体。这可能意味着标题不是媒体内容中对话的1:1映射。但是,对于具有静音属性的视频组件,字幕是不必要的。

 his rule takes one optional object argument of type object:

翻译后

他的规则有一个object类型的可选对象参数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小鱼程序员

你的鼓励将是我创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值