媒体错误:不支持格式或来源 [英] Media error: Format(s) not supported or source(s)

查看:3630
本文介绍了媒体错误:不支持格式或来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为视频使用媒体播放器,我正在尝试播放hls和dash视频格式在ios和android中都可以. 这是我到目前为止所拥有的.

I am using media player js for my video, I am trying to play hls and dash video format in both ios and android. Here is what I have so far.

实时演示代码笔:实时演示

HTML

<div class="video">
   <video id="player1" muted autoplay controls preload="none">

数据-质量="SD">

data - quality = "SD" >

这是JS

$('video').mediaelementplayer({
    features: ['playpause', 'current', 'progress', 'duration', 'volume', 'fullscreen', 'quality'],
    stretching: "responsive",
    enableAutosize: false,
    startVolume: 0.5,
    success: function(mediaElement, domObject) {
        mediaElement.setVolume(0.5);
        console.log(mediaElement);
    }
});

现在,当我在移动设备上检查(ANDROID)时,出现以下错误:

Now when I check on a mobile device (ANDROID) I get the following error:

Media error: Format(s) not supported or source(s) not found

**

注意:在iPhone上,一切正常,问题出在Android设备上

NOTE: on iPhone, everything is okay problem is with an android device

**

我需要怎么做才能解决此问题?任何帮助或建议将不胜感激

What do I need to do to solve this problem? any help or suggestions will be appreciated

推荐答案

有关此错误的将来参考,请确保您具有正确的编解码器正确的hls文件,这是有关如何将mp4转换为hls文件的教程,正确的方式

For future reference about this error, make sure u have the right hls files with the right codecs , here is tutorial on how to convert mp4 to hls files , the right way

https://docs.peer5.com/guides/production-ready-hls-vod/

这篇关于媒体错误:不支持格式或来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆