Player error no src

Display Error Messages Plugin

Overview

The error messages plugin allows the player to display user-friendly messages when it encounters an error. The default style sheet displays messages as a semi-transparent overlay on top of the video element itself. You can change existing message text and add your own styles. You can even create custom messages that are triggered when you want.

The error message shown in the image above was created by updating the player with an invalid src value in the sources property.

The error messages plugin is a default plugin and is automatically loaded with the Brightcove Player. However, you can choose not to load it. Without this plugin, you will see a limited set of error messages and some errors will only appear in the browser console. For details on how to not load a default plugin when you create a player, see the Player Plugin Overview document.

Get started

To update all instances of your player, you can implement a custom plugin using the Brightcove Players module from Studio. This approach is used in the following sections to update the error messages plugin for your player. If you choose to update this plugin from a page of code, it will only affect that instance of your player.

To update the plugin from your page code, first get a reference to the Brightcove Player. In this example, in the JavaScript we are creating a variable named myPlayer and assigning it a reference to the player.

Localize errors

The errors plugin supports multiple languages. To add language support, after the plugin has loaded load the particular language file you wish to use:

You can then use the techniques shown in the Programmatically Localizing Brightcove Player document to localize error messages.

bc-catalog-error

It is possible that handling errors in the normal ready() section in the script block can cause issues. For instance, it can happen that the bc-catalog-error event could be dispatched before the player is ready, and if you listen for the error in the ready() section, you will not be able to handle the error. This issue can occur when using geo-filtering, a video is inactive, a video is out of scheduling range, or in a different account. You may find that there is not a problem in your code, but the issue can browser dependent, so use caution.

For example, here is plugin code that displays a message when a video is inactive:

Exaggerated error rate

If you are getting what seems like an unreasonable number of reported errors, it is important to know that you can get duplicate error events for the same session, creating this exaggerated error rate. Brightcove Player sends errors to analytics at the exact time, and in the same quantity, as they are reported to the player. For instance, if there is no media in a player, and code somehow calls play() one thousand times in a row, one thousand PLAYER_ERR_NO_SRC errors will be reported to analytics.

If there are a few sessions with tons of errors skewing the analytics, you should consider using the following logic to get a better sense of the actual issues:

Читайте также:  Как прошивка делать meizu

Known issues

  • When playing back HLS sources, behavior after network connectivity is lost is probably not what you would expect. The details are:
    • In version 6.x of Brightcove Player HLS segments are endlessly requested and no MEDIA_ERR_NETWORK ever appears.
    • In version 5.x of Brightcove Player after a period of time (30+ seconds) a PLAYER_ERR_TIMEOUT error appears.
  • When loading videos in Edge on Windows 10 (both within the Studio and in public URLs), a MEDIA_ERR_SRC_NOT_SUPPORTED error is displayed and the video cannot be played.
  • On Android devices and iPhones, the tap events for error messages do not bubble up to the parent video element. This means that you can not close an error message once it appears. This behavior may be a problem if the user is in fullscreen mode, because they will have no way to leave this state.

    This issue is currently being worked on and should be fixed in a future player release. For now, you can try a work-around like this:

    Changelog

    The errors plugin is now integrated into the player and changes to the plugin functionality will be reported in Brightcove Player release notes.

    For historical release notes, see the changelog here.

    Источник

    Brightcove Player Error Reference

    Types of errors

    There are six main types of errors which are briefly described in this section. You can click on the error type to see the specific errors for each type, if applicable.

    • Standard errors dispatched from the Errors Plugin: These error names start with MEDIA_ERR.
    • Custom errors defined by Brightcove and dispatched from the Errors Plugin: These error names start with PLAYER_ERR.
    • Errors dispatched from the Video Cloud catalog: These error names start with VIDEO_CLOUD_ERR. Of course, Brightcove Player customers will never see these errors.
    • Errors dispatched from the HLS plugin: All of these errors have the same type, APPEND_BUFFER_ERR, and the message is retrieved from the browser’s native error.
    • Errors reported in the browser Development Tools Console: These errors are developer oriented as they will only be see in a browser’s Console.
    • Custom errors that are user defined and dispatched by the Errors Plugin: These error names are defined by the user, for example AGE_GATE_ERROR.
    • Network security errors

    Standard errors

    Very generally, media errors occur when issues arise trying to retrieve or playback the media. For instance, if your network connection is lost, or you get an encrypted video that cannot be decrypted, you will get a media error. For complete details see the Standard errors section of the Display Error Messages Plugin document.

    Code Type Headline Message
    1 MEDIA_ERR_ABORTED The video download was canceled You aborted the media playback.
    2 MEDIA_ERR_NETWORK The video connection was lost, please confirm you’re connected to the Internet A network error caused the media download to fail part-way. Currently most helpful for MP4 and/or progressive download video formats. See the Known issues section of the Display Error Messages Plugin document for details.
    3 MEDIA_ERR_DECODE The video is bad or in a format that can’t be played on your browser The media playback was aborted due to a corruption problem or because the media used features your browser did not support.
    4 MEDIA_ERR_SRC_NOT_SUPPORTED This video is either unavailable or not supported in this browser The media could not be loaded, either because the server or network failed or because the format is not supported.
    5 MEDIA_ERR_ENCRYPTED The video you’re trying to watch is encrypted and we don’t know how to decrypt it The video you’re trying to watch is encrypted and we don’t know how to decrypt it.
    Unknown MEDIA_ERR_UNKNOWN N/A An unanticipated problem was encountered, check back soon and try again.

    Custom errors

    Very generally, player errors occur when the video has been loaded, for some reason cannot be played. For instance, if domain, geo or IP restrictions prevent viewing a video, player errors will occur. For complete details see the Custom errors section of the Display Error Messages Plugin document.

    Code Message Description
    -1 PLAYER_ERR_NO_SRC No video has been loaded.
    -2 PLAYER_ERR_TIMEOUT Could not download the video, the default timeout is 45 seconds.
    Not Set PLAYER_ERR_DOMAIN_RESTRICTED This video is restricted from playing on your current domain.
    Not Set PLAYER_ERR_IP_RESTRICTED This video is restricted at your current IP address.
    Not Set PLAYER_ERR_GEO_RESTRICTED This video is restricted from playing in your current geographic region.

    Catalog errors

    Very generally, the catalog will throw errors when there are issues retrieving or initially playing the video or playlist. For instance, if you use a non-existent ID, or an ID from a different account in which the player exists, to retrieve a video you will get a catalog error. For complete details see the Catalog errors section of the Player Catalog document.

    Catalog Error Description
    VIDEO_CLOUD_ERR_ACCOUNT_NOT_FOUND The player has been configured with an invalid Video Cloud account ID.
    VIDEO_CLOUD_ERR_RESOURCE_NOT_FOUND The default playlist ID is invalid.
    VIDEO_CLOUD_ERR_VIDEO_NOT_FOUND The default video is invalid.
    VIDEO_CLOUD_ERR_NOT_PLAYABLE The Video Cloud video is not playable.
    Frequent causes of this error include when a video ID is deactivated or when the scheduled availability has expired.

    HLS plugin errors

    For complete details see the Errors section of the HLS Plugin document.

    HLS Plugin Error Description
    APPEND_BUFFER_ERR The browser threw an error playing back an HLS video.

    Playback Restriction errors

    For errors associated with Brightcove Playback Restrictions, see the Playback Restrictions Error Reference document.

    If you are new to playback restrictions, see the Overview: Brightcove Playback Restrictions document.

    Console errors

    These errors would appear in a console looking something like this:

    Console Message Solution
    VIDEOJS: ERROR: videojs-contrib-ads has not seen a loadstart event 5 seconds after being initialized, but a source is present. This indicates that videojs-contrib-ads was initialized too late. It must be initialized immediately after video.js in the same tick. As a result, some ads will not play and some media events will be incorrect. For more information, see https://github.com/videojs/videojs-contrib-ads#important-note-about-initialization You see this because for the IMA3 plugin to function properly it needs to be loaded right after player initialization, before any other plugins are initialized. See the Implement using code section of the IMA3 Plugin doc for the solution.

    Custom user errors

    For complete details see the Adding custom errors section of the Display Error Messages Plugin document. There are no standard custom user errors.

    Network security errors

    These errors occur when your network security blocks some Brightcove domains and ports.

    Error Code Description
    FLASHLS_ERR_CROSS_DOMAIN The video could not be loaded: crossdomain access denied.
    You may need a crossdomain.xml file at the root of your playlist file that allows the domain you are requesting from (or ‘*’).

    Listening for errors

    You can also listen for all errors using the on() method, using the following:

    If you are playing ads and want to catch all errors, you need to use this:

    Источник

    VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) No compatible source was found for this media. #5606

    Comments

    Description

    I init a videojs instance and when I get a new source, I want to change the source. Unfortunately �I get an error.

    Steps to reproduce

    here are an example in jsbin.
    https://jsbin.com/qusiwik/edit?html,output
    1.init a videojs instance
    2.change the source

    Results

    Expected

    change video source

    Actual && Error output

    source change failed and i get an error

    Additional Information

    versions

    videojs

    browsers

    chrome(I haven’t tried in other browser)

    Do I use wrong function? waiting for your anwser

    The text was updated successfully, but these errors were encountered:

    👋 Thanks for opening your first issue here! 👋

    If you’re reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
    To help make it easier for us to investigate your issue, please follow the contributing guidelines.

    Unfortunately, due to the way that Video.js works currently, if a type is not given and it cannot figure the type out from the URL, it cannot play it back. Adding a type as a source object (or working around it by adding #.mp4 to the url makes it work. The source object approach is the preferred one.

    Hope this helps

    This should be documented somewhere.

    I tried to do this but now my video stops playing after one second of play. Please suggest something that I can do

    «video.js»: «^6.13.0»
    «videojs-contrib-hls.js»: «^3.2.0»
    «vue-video-player»: «^5.0.2»

    It’s working at this link, But why is it not working with the youtube link or google drive link?

    Unfortunately, due to the way that Video.js works currently, if a type is not given and it cannot figure the type out from the URL, it cannot play it back. Adding a type as a source object (or working around it by adding #.mp4 to the url makes it work. The source object approach is the preferred one.

    It’s working at this link, But why is it not working with the youtube link or google drive link?

    Hey, I am building a screen recordder app on electronjs. I record it in HLS format. The chunks are stored locally and are uploaded simultaneously. In my app I am building a video preview from the chunks stored locally. I have the path for playlist.m3u8 file. I load the videopreview using the path of that file as src in videojs options.

    I’ve specified the correct type ( application/x-mpegURL ) also. Still getting the error — VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) No compatible source was found for this media .

    Videojs version — 7.11.4
    Chrome version — 87.0.4280.141 (Official Build) (64-bit)

    @ParfectShot if you’re loading a file:/// path, it won’t work. We must be able to make XHR requests. Make sure you have a local server you can hit.

    Hey, I am building a screen recordder app on electronjs. I record it in HLS format. The chunks are stored locally and are uploaded simultaneously. In my app I am building a video preview from the chunks stored locally. I have the path for playlist.m3u8 file. I load the videopreview using the path of that file as src in videojs options.

    I’ve specified the correct type ( application/x-mpegURL ) also. Still getting the error — VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) No compatible source was found for this media .

    Videojs version — 7.11.4 Chrome version — 87.0.4280.141 (Official Build) (64-bit)

    I have the exact same issue!

    © 2023 GitHub, Inc.

    You can’t perform that action at this time.

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

    Источник

Smartadm.ru
Adblock
detector