Its peatty sad that developer does not understand what is actualy going on and can no even explain his own position using using tech knowledge. You are not good developer then. At least Ive tried to eplain the porblem but from you and some use users I can only hear that v1 will save the world and will return pink unicorns to our street … and unicorns will make a rainbow made of skittles.
Will you explain? Lets take two major problems of version from apps store.
-
Its “loop problem” … this problem meay lead for several issues is app. For eg “PIN loop” or “Signin code loop”. Cuerrent version from the apps store uses HTML/JavaScript API for storing some data on TV … for eg it uses sessionStorage to store session (temp) data while it navigates between screens. But in some cases when app calls function to write data to sessionStorage it just ignores it and does not save it. The app is trying to navigate to next screen and after navigaton is done app tries to load data from sessionStorage and check if evrithing is correct and all nesessary data is avalible. But as sessionStorage did not save data app have to return back and ask ppl for PIN code or ask to resign.
Hmm… How should I fix this problem on my side? I can not fix such starnge API behaviour as its probably is in web engine which is hosting the html app/page (AppleWebKit/Chromium).
But how we can try to bypass this issue and even more is it possible to bypass it … Propobly yes … but I can not garanty that fix will work 100%. I had to rewrite the app not to use sessionStorage at all. I even made some changes to reduce wirtes to localStorage whcih is used to store permanent app data (settings or plex account information). Now it debounces all writes to localStorage.
How can we explain this problem? Hm… interested question. But lets try to do that. First of all Im not a web browser’s develper and I’m a specialist in all IT spheres … only @Metasyntactic can be super duper developer who can not even provide valuable information and exlain the problem. As for me I can only guess. The web engine (AppleWebKit/Chromium) which is used by webOS to host HTML based apps uses SQLite db files for sessionStorage and localStorage. And there is propobly a issue with multithreading. And when app tries to make several writes at the same time it may lead to db file corruption. But HOLD ON … you can say that javascript is a single threading scripting language. Yes BUT it has “Web Workers”, timeouts and intervals … it allows to run some part of source code in a separate thread. And it’s probably more valid for “Web Workers” than timeouts and intervals. So … I guess that writing to sessionStorage and localStorage is not thread safe functionality especialy becouse TV has not so powerfull CPU or permanent storage is not so fast to handle writes fast enought to do not catch internal colision.
-
Lets speak about another problem … its “playback problem” … It also has several variants issues. In one it may lead to the situation when you video content is continiusly buffering it. And the second varian of playback issue is when the app even do not start playback at all.
First of all we need to understand that HTML app has no own media content players. It uses players which web engine proviedes to it. It means that suuport of media container types or media codec depends from web engine (AppleWebKit/Chromium) and webOS as webOS hosts web engine. Compatibility depends from webOS version … from TV platform. TV models are sharing its tv platform with several TV models.
So what about continius buffering issue … As we read from @Dad-Admin post it may be the problem how TV works with WiFI or wire connection. The app can not control such aspect of using the app. The is also possibe probelm with VIDEO tag (HTML video player) which is used by the app for video playback.
What about the situation when the app can not even start vide playback its defently somehow connected with HTML VIDEO tag. Ive already shaerd video with my tests how I was able to catch this playback issue. Anyway as @Metasyntactic is a developer I suppose that he can provide some valuable ideas what is wrong with my app. He is some part of soure code where vide player starts and initialize the video player GUI.
At this moment we already see curtains with media art. It also shows red loading spinner.
Here wa attach event lisnteners to know what is going on with vide playback
vm.$refs.player.addEventListener(‘error’, vm.playerOnError);
vm.$refs.player.addEventListener(‘invalid’, vm.playerOnError);
vm.$refs.player.addEventListener(‘canplay’, vm.playerOnCanPlay);
vm.$refs.player.addEventListener(‘timeupdate’, vm.playerOnTimeUpdate);
vm.$refs.player.addEventListener(‘play’, vm.playerOnPlay);
vm.$refs.player.addEventListener(‘pause’, vm.playerOnPaused);
vm.$refs.player.addEventListener(‘ended’, vm.playerOnEnded);
vm.$refs.player.addEventListener(‘seeking’, vm.playerOnWaiting);
vm.$refs.player.addEventListener(‘waiting’, vm.playerOnWaiting);
Here is one more event listener which waits for event from VIDEO tag which will indicate that VIDEO tag has loaded meta data. And after app got it it changes spinner color from red to orange
vm.$refs.player.addEventListener(‘loadedmetadata’, function (event)
{
var el = document.getElementById(‘player-loading’);
if(el) el.classList.remove(‘red’);
});
After we have attached event listeners the app tells to VIDEO tag which url to play.
vm.$refs.source.setAttribute(‘type’, vm.video.source.type + (vm.video.source.transcode === false && vm.video.source.options ? ‘;mediaOption=’ + escape(JSON.stringify(vm.video.source.options)) : ‘’));
vm.$refs.source.setAttribute(‘src’, vm.video.source.source);
vm.$refs.player.setAttribute(‘preload’, ‘auto’);
vm.$refs.player.appendChild(vm.$refs.source);
And after all done it wait 250 milliseconds and tells to VIDEO tag to load media file … actualy this is the start point after VIDEO tag do start media load
setTimeout(function() { vm.$refs.player.load(); }, 250);
And after the VIDEO tag loaded enought media data it throws event “canplay”
And after the app got this event it calls “play()” function.
So where here you can see the problem? v1 has the same logic of video playback start. The only difference between v1 and v2 how video playback starting is that v2 shows RED loading spinner and changes it to orange. The logic of video playback starting on HTML app/page actualy will not have major difference. It may have more or less event listeners or “play()” can be called automaticly by VIDEO tag itself after it got evrithing for playback … and that is all.
So … in our situation VIDEO tag does not even throw events “loadedmetadata”, “canplay” and does not therow error event “error” … hm. How HTML app/page should this issue? Could you explain? I can even add more … that sometimes after app calls “play()” function it returns “endless” JS promise … and this promise will not be resolved and as its not resolved VIDEO tag does not start playback.
You are trying to speak that v1 is a magic pill which will save the world but does not explain how … and why … as v1 and v2 will share the same VIDEO tag or better to say the same web engine (AppleWebKit/Chromium) it will not make any difference. As major issue is somewhere inside web engine or webOS as hosing OS. Ive no idea and only can guess but I can insist on that the problem can not fixed on app’s side and the app can not bypass such problems. The app only “asks” VIDEO tag to play url which is pointing to media file on PMS side. And what will VIDEO tag do I can only guess especialy becouse it does not throw any events to notify app about situation.
And trying to compared official app with the app is a bit incorrect. Official client will always use transcoder for better media content compatibility. It means that transcoder will transcode for eg 100-200 mb of media content and will wait untill VIDEO tags ask for another portion media content. What about XPlay … by default it uses direct media files url … it means that if media file has 2 Gb body TV will try to download it fully (to temp folder or to RAM Ive no idea) … or for eg if we speak about hight birated 4k content it will try to download for eg 30Gb to TV for playback. And propobly there is some memory leaking issue or anything else.
PS
Im not a webOS developer and Ive not deleoping web browser but at least I do understand how some parts are works. And at least I do try to explain the problems from tech side. But here only magic words like v1 will save us … it will save the world … you are thif and etc
At least to try to fight with LG Corp to solve the situation and what about you @Metasyntactic … what did you do to resolve the situaitin? I can only see useless posts here and valuable information … No help in twitter and etc … Im a developer … Ive 24 exp in IT sphere and etc … only bla bla bla …
The situation is quite simple LG is reducing doumented API which was avalible for developers … and trying to punish developers for continuing to using it … It does not accept the situation where issue is not on app’s side and this issue in webOS … in web engine which is actualy hosting HTML apps and do media playback. Of course it’s easier to say that app must fix issue. And they will not have to spend some extra mony to fix the probem. Its not a big problem for LG to have -1 app in apps store. LG just does not respect its customers and this is the main problem.
I can not even publish updates becouse LG is creating artifical borders to prevent app from updating. They are even trying to fool me with file version … its rediculas as I know what I do … and I store all files which I uploads in LG seller’s cabinet.
@Metasyntactic I’ll accept and admint your exp if you explain how HTML app/page can have more control over VIDEO tag … and how I can influance to buffering … and etc … but for the moment only bla bla bla