Skip to content

HLS live stream on shaka player on wpewebkit 2.28 brcm nexus STB not playing #8324

@laurence-ejraee

Description

@laurence-ejraee

Have you read the FAQ and checked for duplicate open issues?
Yes

If the problem is related to FairPlay, have you read the tutorial?

n/a

What version of Shaka Player are you using?

4.14.2

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from main?
Yes

Are you using the demo app or your own custom app?
Custom app

If custom app, can you reproduce the issue using our demo app?
n/a cannot run on the STB

What browser and OS are you using?
wpewebkit 2.28 on STB with brcm nexus.

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
Custom brcm nexus STB

What are the manifest and license server URIs?

https://storage.googleapis.com/shaka-live-assets/player-source.m3u8

What configuration are you using? What is the output of player.getNonDefaultConfiguration()?

streaming: Object
bufferBehind: 5
bufferingGoal: 30
gapPadding: 0
useNativeHlsForFairPlay: false

What did you do?

Run my simple demo html.

What did you expect to happen?
Live playback to work as seen on Chrome.

What actually happened?

Playback doesn't start, the first frame is shown in the video but no playback, the html video bar says "Loading". Shaka errors:
Possible encoding problem detected! – "Unexpected buffered range for reference" (7) {startTime: 3720, endTime: 3724.011, trueEndTime: 3724.011, getUrisInner: function, startByte: 0, …} "from URIs" ["https://storage.googleapis.com/shaka-live-assets/player-source/audio_und_2c_128k_aac_1459317.mp4"] (1) "should be" {start: 3720, end: 3724.011} "but got" {start: 5840855.999999, end: 5840860.010666}

Are you planning to send a PR to fix it?
No

HTML demo:

`<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Shaka Player HLS Demo</title>
    <!--script defer src="https://github.com/videojs/mux.js/releases/download/v6.3.0/mux.min.js"></script>
    <script defer src="./mux.min.js"></script-->
    <!--script defer src="https://ajax.googleapis.com/ajax/libs/shaka-player/4.14.2/shaka-player.compiled.js"></script-->

    <!--script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/mux.min.js"></script>
	<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/shaka-player.compiled.js"></script-->

	<script defer src="https://github.com/videojs/mux.js/releases/download/v6.3.0/mux.min.js"></script>
	<script defer src="https://ajax.googleapis.com/ajax/libs/shaka-player/4.14.2/shaka-player.compiled.debug.js"></script>

</head>
<body style="background-color:white;">
    <h1>Shaka Player HLS Streaming Example</h1>

    <!-- Video element -->
    <video id="video"
           width="640" height="480"
           crossorigin="anonymous"
           autoplay
           controls>
      Your browser does not support HTML5 video.
    </video>

    <script>
	const manifestUri = "https://storage.googleapis.com/shaka-live-assets/player-source.m3u8";

	function initApp() {
	  setTimeout( () => { 
		  // Install built-in polyfills to patch browser incompatibilities.
		  shaka.polyfill.installAll();
		  initPlayer();	  
	  }, 3000);
	}

    var player;

	function initPlayer() {
            // Create a Shaka Player instance and bind it to the video element
            const video = document.getElementById('video');
            player = new shaka.Player(video);

            // Listen for error events
            player.addEventListener('error', onErrorEvent);

            player.configure({
            	autoShowText: 3,
            	ignoreHardwareResolution: false,
            	preferForcedSubs: false,
            	preferSpatialAudio: false,
            	preferredAudioChannelCount: 2,
            	abr: {
            		advanced: {
            			minTotalBytes: 128000, minBytes: 16000, fastHalfLife: 2, slowHalfLife: 5
            		},
            		bandwidthDowngradeTarget: 0.95,
            		bandwidthUpgradeTarget: 0.85,
					cacheLoadThreshold: 20,
					clearBufferSwitch: false,
					defaultBandwidthEstimate: 1000000,
					enabled: true,
					ignoreDevicePixelRatio: false,
					minTimeToSwitch: 0,
					preferNetworkInformationBandwidth: false,
					restrictToElementSize: false,
					restrictToScreenSize: false,
					safeMarginSwitch: 0,
					switchInterval: 8,
					useNetworkInformation: true
            	},
            	cmsd: {
            		enabled: true,
            		applyMaximumSuggestedBitrate: true,
            		estimatedThroughputWeightRatio: 0.5
            	},
            	manifest: {
            		availabilityWindowOverride: NaN,
            		continueLoadingWhenPaused: true,
            		defaultPresentationDelay: 0,
            		disableAudio: false,
            		disableIFrames: false,
            		disableText: false,
            		disableThumbnails: false,
            		disableVideo: false,
            		hls: {
						allowLowLatencyByteRangeOptimization: true,
						allowRangeRequestsToGuessMimeType: false,
						defaultAudioCodec: "mp4a.40.2",
						defaultVideoCodec: "avc1.42E01E",
						disableClosedCaptionsDetection: false,
						disableCodecGuessing: false,
						ignoreImageStreamFailures: false,
						ignoreManifestProgramDateTime: false,
						ignoreManifestTimestampsInSegmentsMode: false,
						ignoreTextStreamFailures: false,
						liveSegmentsDelay: 3,
						mediaPlaylistFullMimeType: "video/mp2t; codecs=\"avc1.42E01E, mp4a.40.2\"",
						sequenceMode: true,
            		},
					ignoreDrmInfo: false,
					ignoreSupplementalCodecs: false,
					raiseFatalErrorOnManifestUpdateRequestFailure: false,
					segmentRelativeVttTiming: false,
					updatePeriod: -1
            	},
            	mediaSource: {
					codecSwitchingStrategy: "reload",
					dispatchAllEmsgBoxes: false,
					forceTransmux: false,
					insertFakeEncryptionInInit: true
            	},
            	streaming: {
					allowMediaSourceRecoveries: true,
					alwaysStreamText: false,
					avoidEvictionOnQuotaExceededError: false,
					bufferBehind: 5,
					bufferingGoal: 30,
					clearDecodingCache: false,
					crossBoundaryStrategy: "keep",
					disableAudioPrefetch: false,
					disableTextPrefetch: false,
					disableVideoPrefetch: false,
					dontChooseCodecs: false,
					durationBackoff: 1,
					evictionGoal: 1,
					forceHTTP: false,
					forceHTTPS: false,
					gapDetectionThreshold: 0.5,
					gapJumpTimerTime: 0.25,
					gapPadding: 0,
					ignoreTextStreamFailures: false,
					inaccurateManifestTolerance: 2,
					liveSync: {
						dynamicTargetLatency: {
							enabled: false,
							maxAttempts: 10,
							maxLatency: 4,
							minLatency: 1,
							rebufferIncrement: 0.5,
							stabilityThreshold: 60
						},
						enabled: false,
						maxPlaybackRate: 1.1,
						minPlaybackRate: 0.95,
						panicMode: false,
						panicThreshold: 60,
						targetLatency: 0.5,
						targetLatencyTolerance: 0.5,
					},
					loadTimeout: 30,
					lowLatencyMode: false,
					maxDisabledTime: 30,
					minBytesForProgressEvents: 16000,
					minTimeBetweenRecoveries: 5,
					observeQualityChanges: false,
					preferNativeDash: false,
					preferNativeHls: false,
					preloadNextUrlWindow: 30,
					rebufferingGoal: 0,
					safeSeekEndOffset: 0,
					safeSeekOffset: 5,
					segmentPrefetchLimit: 1,
					shouldFixTimestampOffset: false,
					stallEnabled: true,
					stallSkip: 0.1,
					stallThreshold: 1,
					startAtSegmentBoundary: false,
					updateIntervalSeconds: 1,
					useNativeHlsForFairPlay: false,
					vodDynamicPlaybackRate: false,
					vodDynamicPlaybackRateBufferRatio: 0.5,
					vodDynamicPlaybackRateLowBufferRate: 0.95
            	}
            });

            // Try to load the manifest URL (HLS)
            player.load(manifestUri).then(function() {
                console.log('HLS manifest loaded successfully');
                video.play();
            }).catch(onError);  // Catch errors
    }


        // Error handling function
        function onErrorEvent(event) {
            // Extract the error from the event object
            const error = event.detail;
            console.error('Error code', error.code, 'object', error);
        }

        // Function to handle any errors
        function onError(error) {
            console.error('Error code', error.code, 'object', error);
        }

	document.addEventListener('DOMContentLoaded', initApp);



	// Initial config:
	/*
            player.configure({
            	autoShowText: 3,
            	ignoreHardwareResolution: false,
            	preferForcedSubs: false,
            	preferSpatialAudio: false,
            	preferredAudioChannelCount: 2,
            	abr: {
            		advanced: {
            			minTotalBytes: 128000, minBytes: 16000, fastHalfLife: 2, slowHalfLife: 5
            		},
            		bandwidthDowngradeTarget: 0.95,
            		bandwidthUpgradeTarget: 0.85,
					cacheLoadThreshold: 20,
					clearBufferSwitch: false,
					defaultBandwidthEstimate: 1000000,
					enabled: true,
					ignoreDevicePixelRatio: false,
					minTimeToSwitch: 0,
					preferNetworkInformationBandwidth: false,
					restrictToElementSize: false,
					restrictToScreenSize: false,
					safeMarginSwitch: 0,
					switchInterval: 8,
					useNetworkInformation: true
            	},
            	cmsd: {
            		enabled: true,
            		applyMaximumSuggestedBitrate: true,
            		estimatedThroughputWeightRatio: 0.5
            	},
            	manifest: {
            		availabilityWindowOverride: NaN,
            		continueLoadingWhenPaused: true,
            		defaultPresentationDelay: 0,
            		disableAudio: false,
            		disableIFrames: false,
            		disableText: false,
            		disableThumbnails: false,
            		disableVideo: false,
            		hls: {
						allowLowLatencyByteRangeOptimization: true,
						allowRangeRequestsToGuessMimeType: false,
						defaultAudioCodec: "mp4a.40.2",
						defaultVideoCodec: "avc1.42E01E",
						disableClosedCaptionsDetection: false,
						disableCodecGuessing: false,
						ignoreImageStreamFailures: false,
						ignoreManifestProgramDateTime: false,
						ignoreManifestTimestampsInSegmentsMode: false,
						ignoreTextStreamFailures: false,
						liveSegmentsDelay: 3,
						mediaPlaylistFullMimeType: "video/mp2t; codecs=\"avc1.42E01E, mp4a.40.2\"",
						sequenceMode: true,
            		},
					ignoreDrmInfo: false,
					ignoreSupplementalCodecs: false,
					raiseFatalErrorOnManifestUpdateRequestFailure: false,
					segmentRelativeVttTiming: false,
					updatePeriod: -1
            	},
            	mediaSource: {
					codecSwitchingStrategy: "reload",
					dispatchAllEmsgBoxes: false,
					forceTransmux: false,
					insertFakeEncryptionInInit: true
            	},
            	streaming: {
					allowMediaSourceRecoveries: true,
					alwaysStreamText: false,
					avoidEvictionOnQuotaExceededError: false,
					bufferBehind: 30,
					bufferingGoal: 10,
					clearDecodingCache: false,
					crossBoundaryStrategy: "keep",
					disableAudioPrefetch: false,
					disableTextPrefetch: false,
					disableVideoPrefetch: false,
					dontChooseCodecs: false,
					durationBackoff: 1,
					evictionGoal: 1,
					forceHTTP: false,
					forceHTTPS: false,
					gapDetectionThreshold: 0.5,
					gapJumpTimerTime: 0.25,
					gapPadding: 0,
					ignoreTextStreamFailures: false,
					inaccurateManifestTolerance: 2,
					liveSync: {
						dynamicTargetLatency: {
							enabled: false,
							maxAttempts: 10,
							maxLatency: 4,
							minLatency: 1,
							rebufferIncrement: 0.5,
							stabilityThreshold: 60
						},
						enabled: true,
						maxPlaybackRate: 1.1,
						minPlaybackRate: 0.95,
						panicMode: false,
						panicThreshold: 60,
						targetLatency: 0.5,
						targetLatencyTolerance: 0.5,
					},
					loadTimeout: 30,
					lowLatencyMode: false,
					maxDisabledTime: 30,
					minBytesForProgressEvents: 16000,
					minTimeBetweenRecoveries: 5,
					observeQualityChanges: false,
					preferNativeDash: false,
					preferNativeHls: false,
					preloadNextUrlWindow: 30,
					rebufferingGoal: 10,
					safeSeekEndOffset: 0,
					safeSeekOffset: 5,
					segmentPrefetchLimit: 1,
					shouldFixTimestampOffset: false,
					stallEnabled: true,
					stallSkip: 0.1,
					stallThreshold: 1,
					startAtSegmentBoundary: false,
					updateIntervalSeconds: 1,
					useNativeHlsForFairPlay: false,
					vodDynamicPlaybackRate: false,
					vodDynamicPlaybackRateBufferRatio: 0.5,
					vodDynamicPlaybackRateLowBufferRate: 0.95
            	}
            });
    */




    </script>
</body>
</html>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: HLSThe issue involves Apple's HLS manifest formatplatform: TV/STBIssues affecting smart TV or set-top box platformspriority: P2Smaller impact or easy workaroundstatus: archivedArchived and locked; will not be updatedtype: bugSomething isn't working correctly

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions