Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

videojs.log.history is empty on iphone ios #8935

Closed
RodionPushkin opened this issue Dec 7, 2024 · 5 comments
Closed

videojs.log.history is empty on iphone ios #8935

RodionPushkin opened this issue Dec 7, 2024 · 5 comments

Comments

@RodionPushkin
Copy link

videojs.log.history is empty on iphone ios, i have a same bug on other versions of package, 6.x.x, 7.x.x, 8.x.x., work with a hls player, and i need to access to the log history, but only on iphone i have a empty array when use console.log(videojs.log.history()) Image

waiting for your response about this problem, also in iphone i got bug with player.on("error"....., videojs cant handle errors, i dont know why, thats only problem in iphone, i have tested this in browserstack on iphone 15 safari and chrome browsers, and have tested it on my own iphone, also i have tested this on mac and windows on browserstack and all is good, no issues, and i tested it on my work mac and windows computer, and take the same result, problems only on iphone

Copy link

welcome bot commented Dec 7, 2024

👋 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.

@RodionPushkin
Copy link
Author

RodionPushkin commented Dec 7, 2024

my code on react

videojsPlayerRef.current = videojs(videojsRef.current, {
      autoplay: true,
      controls: true,
      preload: "auto",
      sources: [
        {
          src: "...",
          type: "application/x-mpegURL",
          withCredentials: false,
        },
        {
          src: "...",
          type: "application/x-mpegURL",
          withCredentials: false,
        },
        {
          src: "...",
          type: "application/x-mpegURL",
          withCredentials: false,
        },
      ],
      controlBar: {
        playToggle: true,
        volumePanel: true,
        currentTimeDisplay: true,
        timeDivider: true,
        durationDisplay: true,
        progressControl: true, 
        fullscreenToggle: true, 
      },
      playsinline: true,
      html5: {
        nativeTextTracks: false,
        nativeAudioTracks: false,
        nativeVideoTracks: false,
        nativeControlsForTouch: false, 
        overrideNative: true,
        hls: {
          overrideNative: true,
          enableLowInitialPlaylist: true,
          limitRenditionByPlayerDimensions: false,
          smoothQualityChange: true,
          useDevicePixelRatio: false,
          withCredentials: false,
        },
        vhs: {
          overrideNative: true,
          enableLowInitialPlaylist: true,
          limitRenditionByPlayerDimensions: false,
          smoothQualityChange: true,
          useDevicePixelRatio: false,
          withCredentials: false,
        },
      },
    });
videojsPlayerRef.current.on("error", function () {
      console.log("player error");
    });

    const interval = setInterval(() => {
      console.log(JSON.stringify(videojs.log.history()));
    }, 1000);

      <video
        ref={videojsRef}
        className="video-js vjs-default-skin w-screen"
        webkit-playsinline
        playsInline
        x-webkit-airplay="allow"
        x5-video-player-type="h5"
        x5-video-player-fullscreen="true"
        x5-video-orientation="portraint"
      />

@RodionPushkin
Copy link
Author

videojs on iphone uses native hls player, and i think this is the reason why i cant access to player.on("error"... and reason why history array is empty, but event player.on("waiting"... works pretty good

@RodionPushkin
Copy link
Author

in my project we use history() to access to warnings and etc for using that to switch sources to lower resolution when cdn gives broken fragment

@mister-ben
Copy link
Contributor

iPhone's native playback won't necessarily trigger errors in the same conditions, nor does it log anything. It's a black box.

Latest iOS on iPhone has support for Managed Media Source Extensions, with which we can play HLS with our VHS playback engine. It's still considered experimental - we don't know if we've seen every edge case yet - but you could try it out for your use case as detailed in the comment linked below.

#8931 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants