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

[object ArrayBufferConstructor] is not a function #1022

Closed
SemihGk opened this issue Sep 13, 2017 · 13 comments
Closed

[object ArrayBufferConstructor] is not a function #1022

SemihGk opened this issue Sep 13, 2017 · 13 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@SemihGk
Copy link
Contributor

SemihGk commented Sep 13, 2017

Have you read the FAQ and checked for duplicate issues:
Yes
What version of Shaka Player are you using:
2.2.0
Can you reproduce the issue with our latest release version:
Yes
Can you reproduce the issue with the latest code from master:
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:
No.
What browser and OS are you using:
Samsung 2016 Tv. User-agent: Mozilla/5.0 (SMART-TV; Linux; Tizen 2.4.0) AppleWebKit/538.1 (KHTML, like Gecko) Version/2.4.0 TV

What are the manifest and license server URIs:
(you can send the URIs to shaka-player-issues@google.com instead, but please use GitHub and the template for the rest)
It only occurs in Samsung 2016 TV. If you have 2016 Samsung TV to test(also you would need Tizen Studio), I would be happy to share it. Otherwise, it is not reproducible.

What did you do?
When I try to load manifest into shaka.Player.load function, it throws this error.

What did you expect to happen?
It should not throw the error.

What actually happened?
First of all, this application works on latest browsers and 2017 Samsung TV as well. This error is only caught in 2016 TV. So, it is hard to test it. Honestly, I would not even say this is a valid bug since 2016 TV has very old version of WebKit browser. However, I am stuck at this point and I am wondering do you have any idea what it may cause this error. I will appreciate any help. Please check the screenshot. You will notice it does not even show the error line. Also, yes I checked ArrayBuffer is supported by the webkit browser. Thank you.

screen shot 2017-09-13 at 4 02 32 pm

@TheModMaker
Copy link
Contributor

First, can you try with the uncompiled library? It would be helpful to see a stack trace of this, the stack trace in the screenshot doesn't look right (or in the library). Also, how are you loading Shaka Player? The top-level object doesn't look familiar, is it a wrapped error from some other library or the platform? Is com.quickplay.plugins.shakaPlayer from your app (again doesn't look familiar)?

@SemihGk
Copy link
Contributor Author

SemihGk commented Sep 13, 2017

Thank you for your reply, @TheModMaker . Yes, you are right! Stack trace is appeared when I inject the uncompiled library. I was importing the compiled.debug.js (it seems it is a bad idea).
Stack trace

 "exports↵exports↵slice
↵readBytes@file:///opt/usr/apps/GojX41wt1P/res/wgt/lib/util/data_view_reader.js:206:42
↵parseNext@file:///opt/usr/apps/GojX41wt1P/res/wgt/lib/util/mp4_parser.js:185:35
↵parse@file:///opt/usr/apps/GojX41wt1P/res/wgt/lib/util/mp4_parser.js:141:19
↵parseInit@file:///opt/usr/apps/GojX41wt1P/res/wgt/lib/text/mp4_ttml_parser.js:56:15
↵file:///opt/usr/apps/GojX41wt1P/res/wgt/lib/text/text_engine.js:145:29
↵[native code]↵run↵↵flus

Also, yes it is a wrapper from our application. It doesn't override the functions. It just initializes the shaka-player. Now, I am able to trace the bug. After some investigation, I will share the result. Thanks a lot again.

screen shot 2017-09-13 at 6 06 07 pm

@SemihGk
Copy link
Contributor Author

SemihGk commented Sep 14, 2017

After I dug into this bug more, I found out WebKit browser partially does not support ArrayBuffer.slice() method. Specifically, slice method exists but only takes one parameter. The second parameter was causing this error. So, I had to override the ArrayBuffer.slice method based on Claudiu's answer from this link ArrayBuffer.slice override

This topic can be closed unless you want to add this support for old browsers. Thank you for your help again.

@SemihGk SemihGk closed this as completed Sep 14, 2017
@TheModMaker
Copy link
Contributor

If that is the only bug here, I think we can work around it. It would be nice to be able to support this browser.

@TheModMaker TheModMaker reopened this Sep 14, 2017
@TheModMaker TheModMaker added type: enhancement New feature or request and removed needs triage labels Sep 14, 2017
@TheModMaker TheModMaker self-assigned this Sep 14, 2017
@TheModMaker TheModMaker added this to the v2.3.0 milestone Sep 14, 2017
@SemihGk
Copy link
Contributor Author

SemihGk commented Sep 14, 2017

Well, I cannot say this is the only bug. There is also another bug which was reported here . I had to override cloneObject function based on cloneDeep. I do not receive any error so far. I can keep this topic updated if you are interested. Thank you.

@SemihGk
Copy link
Contributor Author

SemihGk commented Sep 15, 2017

@TheModMaker, I have been facing another issue. This might be more likely a StackOverflow question, but I will really appreciate any help. Because I am really desperate at this point.

As I said above, this application works on latest browsers and not working in this WebKit browser. Problem is that video is not playing and there is no error (also listened 'uncaught errors' in case of missing promise catch blocks). That's why I do not know how to troubleshoot.

So far, I realized video blob file is created and video source is loaded into video element as well. Please check screenshots. The question is here is it possible that browser cannot detect the video codecs or video type somehow? Or what are the other possibilities that I can look for? Please accept my apologies for the unrelated question in this topic.

image uploaded from ios 1
screen shot 2017-09-15 at 10 51 17 am

@TheModMaker
Copy link
Contributor

Here are some things to check:

  • Are we downloading segments?
  • video.readyState, video.playbackRate, video.paused, video.error
  • player.isBuffering() (in the default demo it would be shakaDemo.localPlayer_.isBuffering())
  • video events: playing, loadedmetadata, waiting (add listener before calling player.load())
  • Try calling video.play() and try setting video.currentTime to force a seek

What is the value of video.buffered? You'll need to manually get the ranges, for example:

var b = [];
for (var i = 0; i < video.buffered.length; i++)
  b.push([video.buffered.start(i), video.buffered.end(i)]);

If you are using the uncompiled library, you can also set the log level to get more info. This could be used to see if something stalls or if we append segments successfully.

shaka.log.setLevel(shaka.log.Level.DEBUG);
shaka.log.setLevel(shaka.log.Level.V1);
shaka.log.setLevel(shaka.log.Level.V2);

@SemihGk
Copy link
Contributor Author

SemihGk commented Sep 18, 2017

@TheModMaker. Thank you so much for the reply. Actually, I checked some of them before, but it does not still explain what's the problem for me.

  • Are we downloading segments?
    Yes, I checked the manifest. It has the segmets.

  • video.readyState, video.playbackRate, video.paused, video.error
    when loadedmetadata is fired: readyState: 3, playbackRate: 0, paused: true, error: null,
    if I try to force to play, readyState: 0, playbackRate: 0, paused: false, error: MediaError code 4.

  • player.isBuffering() (in the default demo it would be shakaDemo.localPlayer_.isBuffering())
    returning false

  • video events: playing, loadedmetadata, waiting (add listener before calling player.load())
    only loadedmetadata is triggered.

  • Try calling video.play() and try setting video.currentTime to force a seek
    Tried it. Nothing happens. Also, there is no error.
    However, when I tried video.play() and video.pause(), an error in video element appears which is MediaError code 4(please check screenshots) although shaka does not throw an error.

  • video.buffered: 0 . So, not possible to get ranges.

Do you have any idea why buffered length is 0? Because, I checked the working version. That one's buffered length is 1. What may it cause this? Or what else can I check?

When video is first loaded (loadedmetadata event):

screen shot 2017-09-18 at 12 32 00 pm

screen shot 2017-09-18 at 12 31 44 pm

After forced to play and pause (waiting event):

screen shot 2017-09-18 at 12 31 34 pm

screen shot 2017-09-18 at 12 31 17 pm

@TheModMaker
Copy link
Contributor

  • Are we downloading segments?
    Yes, I checked the manifest. It has the segmets.

I was actually referring to checking the network tab to see if we are actually downloading them.

Do you have any idea why buffered length is 0? Because, I checked the working version. That one's buffered length is 1. What may it cause this? Or what else can I check?

A length of 0 means no content is buffered. This can happen before we download segments, or if the content is not supported.

Media error 4 is MEDIA_ERR_SRC_NOT_SUPPORTED. It looks like the browser doesn't like the MSE source. I see there is a mediaKeys object that doesn't look correct. Are you able to play clear content? Can you try other manifests to see if this is a content problem?

@SemihGk
Copy link
Contributor Author

SemihGk commented Sep 18, 2017

I was actually referring to checking the network tab to see if we are actually downloading them.

Oh, sorry. That's my bad. You are right. It does not download all contents. It stops downloading after 5 chunks (see screenshot). The working one keeps downloading each segment while its playing. However, it does not make sense to me if it is content is unavailable issue. Because, same urls are requested on Chrome one and TV browser one. It should download all contents. Plus, this problems are exists at all different contents (live or VOD).

A length of 0 means no content is buffered. This can happen before we download segments, or if the content is not supported.

Could you expand "the content is not supported" issue a little bit? Does it mean content is simply unavailable(which is unlikely since I can play the content) or content may not be encrypted in the browser?

Media error 4 is MEDIA_ERR_SRC_NOT_SUPPORTED. It looks like the browser doesn't like the MSE source. I see there is a mediaKeys object that doesn't look correct. Are you able to play clear content? Can you try other manifests to see if this is a content problem?

MediaKeys object is different than chrome's. I realized that as well, then I thought this must be added by samsung since webkit(safari) does not support playready natively. Yes, I am able to play clear contents, but I cannot play widevine or playready contents. Regarding this topic 771 , I am having the same issue for the demo app as well. I cannot play any content except first one in the demo app. I see samsung documentation has the playready DRM playready . Do you think this issue may be an encryption issue? Since I am new at shaka-player, I do not know how to trace it from this point if this is the issue.

Thank you so much for your help.

screen shot 2017-09-18 at 3 20 29 pm

@TheModMaker
Copy link
Contributor

From issue #771 it looks like Tizen 2.4 doesn't implement the APIs we need to use PlayReady. The documentation you linked to shows that it uses a custom API to use PlayReady, which we don't support. So it looks like that browser isn't supported for protected content, you can follow #771 to get updates.

@SemihGk
Copy link
Contributor Author

SemihGk commented Sep 18, 2017

Hmm, I never thought playready is only supported in their custom API. I will follow the #771 . However, I will ask Samsung about playready support. Thank you!

shaka-bot pushed a commit that referenced this issue Sep 25, 2017
ArrayBuffer.slice isn't supported with two arguments on Tizen 2016.
This is a temporary fix that can be cherry-picked to v2.2.  A better
fix will be handled in a follow-up change.

Issue #1022

Change-Id: Iae6a0b2ef0cf17843f42f22f0ea0962a56e8be68
joeyparrish pushed a commit that referenced this issue Sep 26, 2017
ArrayBuffer.slice isn't supported with two arguments on Tizen 2016.
This is a temporary fix that can be cherry-picked to v2.2.  A better
fix will be handled in a follow-up change.

Issue #1022

Change-Id: Iae6a0b2ef0cf17843f42f22f0ea0962a56e8be68
@joeyparrish
Copy link
Member

The first part of the fix has been cherry-picked to v2.2.x and will be released in v2.2.2. A deeper refactor is coming, which will land in v2.3.0 due to small API changes.

shaka-bot pushed a commit that referenced this issue Dec 19, 2017
Instead of taking Uint8Array for media segments and ArrayBuffer for
init segments, take Uint8Array for everything.

Clean-up after #1022, discovered while preparing the upgrade guide for
v2.3.

Change-Id: I1f284f6f51f345e663c06d96d788bd9cfb941c52
@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants