Jump to content

Pseudo TV for Emby


VicMoore

Recommended Posts

mickle026
1 hour ago, VicMoore said:

@TZTZoroand @kjhedgesI think I found the problem.  Try the code below;

Vic

PseudoTV.dll 204.5 kB · 2 downloads

@VicMoore

I have not tried this plugin, but in an earlier post it was mentioned that it is working on third time brings back problems I had with one of my plugins.

Only one of the three pages would work.  If this is the same kind of error.....   Here is a snippet of how to load the page that works in all 3 instances.

In a browser there are 3 versions of a page cached with emby (UI Quirks), they dont all update.

You have to change the way you render the html page in the first place in the js

original discussion with devs here

 

define(["loading","require", "jQuery", "globalize", "emby-checkbox", "emby-select", "emby-linkbutton", "emby-input", "emby-button"],

        function (loading) {
            return function (page) 
            {

                    
            	});
            }
        });

 

Edited by mickle026
Link to comment
Share on other sites

VicMoore

yes you are right. I removed the button.  All the button did was reload the html page.  

I will look deeper.

Vic

Link to comment
Share on other sites

VicMoore

@mickle026I greatly enjoyed reading your forum posts where you and @chefdiscussed the problem.  I am not the sharpest knife in the draw, so I need to clarify my understanding of your recommended solution.  First, use  "view" instead of "document" when using "getElementById".  Second, I need to organize my JS code as below:

 

define(['globalize', 'loading', 'appRouter', 'formHelper', 'emby-input', 'emby-button', 'emby-checkbox', 'emby-select'], function (globalize, loading, appRouter, formHelper) {
    'use strict';

   function (loading) {

         // my javascript code here

         return function (view, params)
        {

               view.addEventListener('viewshow', function ()
               {

                     // my javascript code here

               });

         };

     );

});

 

Are my assumptions correct?

Vic

 

Link to comment
Share on other sites

VicMoore

@mickle026I would be very grateful if you would explain what worked for you. 

Vic

Link to comment
Share on other sites

VicMoore

@mickle026I have been experimenting. I changed the core "document.getElementId"  to  "view.querySelector".  I don't know if this helped yet.  @TZTZorocould you try the plugin below and let me know if it loads OK?

Vic

PseudoTV.dll

  • Like 1
Link to comment
Share on other sites

TZTZoro

@VicMoore
Still the same error about the configurationpage.js,
installed the plugin with a reboot without the plugin just to rule that out and refreshed the page and opened the page through the ui multiple times just in case, no luck

Link to comment
Share on other sites

VicMoore

Does it help to reload the page several times?

Link to comment
Share on other sites

TZTZoro

Nope, i still get the same errors as in this post
 

8 hours ago, TZTZoro said:

I am using firefox

 

Uncaught (in promise) TypeError: nameArray is undefined
    activeChannels http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:2965
    getActiveChannels http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:2963
    init http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3033
    fillTunerHostInfo http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3074
    reload http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3062
    promise callback*reload http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3058
    <anonymous> http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3255
    onNewViewDisplayed http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    onViewChange http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    promise callback*onViewChange http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    loadView http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    promise callback*ViewManager.prototype.loadView/< http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    promise callback*ViewManager.prototype.loadView http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    loadContentUrl http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    loadContentUrl http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*loadContentUrl http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    initRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*initRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*handleRoute/</< http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleSignedInResult http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*AppRouter.prototype.handleSignedInResult/< http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleSignedInResult http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleConnectionResult http://host1:8096/web/modules/common/baseapprouter.js?v=4.8.0.66:1
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    dispatch http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    replace http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    start http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    page http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    start http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*appRouter.start http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    onAppReady http://host1:8096/web/app.js?v=4.8.0.66:1
    promise callback*onAppReady http://host1:8096/web/app.js?v=4.8.0.66:1
    promise callback*start http://host1:8096/web/app.js?v=4.8.0.66:1
    <anonymous> http://host1:8096/web/app.js?v=4.8.0.66:1
    <anonymous> http://host1:8096/web/app.js?v=4.8.0.66:1
configurationpage:2965:25
    getActiveChannels http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3000
    InterpretGeneratorResume self-hosted:1465
    AsyncFunctionNext self-hosted:852
    (Async: async)
    init http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3033
    InterpretGeneratorResume self-hosted:1465
    AsyncFunctionNext self-hosted:852
    (Async: async)
    fillTunerHostInfo http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3074
    reload http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3062
    (Async: promise callback)
    reload http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3058
    <anonymous> http://host1:8096/web/configurationpage?name=pseudotvconfigjs&v=4.8.0.66:3255
    onNewViewDisplayed http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    onViewChange http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    (Async: promise callback)
    onViewChange http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    loadView http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    (Async: promise callback)
    loadView http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    (Async: promise callback)
    loadView http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    loadContentUrl http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    loadContentUrl http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    (Async: promise callback)
    loadContentUrl http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    initRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    (Async: promise callback)
    initRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    (Async: promise callback)
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    (Async: promise callback)
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleSignedInResult http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    (Async: promise callback)
    handleSignedInResult http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleSignedInResult http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleConnectionResult http://host1:8096/web/modules/common/baseapprouter.js?v=4.8.0.66:1
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    dispatch http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    replace http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    start http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    page http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    start http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    (Async: promise callback)
    start http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    onAppReady http://host1:8096/web/app.js?v=4.8.0.66:1
    (Async: promise callback)
    onAppReady http://host1:8096/web/app.js?v=4.8.0.66:1
    (Async: promise callback)
    start http://host1:8096/web/app.js?v=4.8.0.66:1
    <anonymous> http://host1:8096/web/app.js?v=4.8.0.66:1
    <anonymous> http://host1:8096/web/app.js?v=4.8.0.66:1


 

Uncaught TypeError: slideeElement is null
    init http://host1:8096/web/modules/scroller/smoothscroller.js?v=4.8.0.66:1
    value http://host1:8096/web/modules/emby-elements/emby-scroller/emby-scroller.js?v=4.8.0.66:1
    loadView http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    promise callback*ViewManager.prototype.loadView http://host1:8096/web/modules/viewmanager/viewmanager.js?v=4.8.0.66:1
    loadContentUrl http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    loadContentUrl http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*loadContentUrl http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    initRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*initRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*handleRoute/</< http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleSignedInResult http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*AppRouter.prototype.handleSignedInResult/< http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleSignedInResult http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    handleConnectionResult http://host1:8096/web/modules/common/baseapprouter.js?v=4.8.0.66:1
    handleRoute http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    dispatch http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    replace http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    start http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    page http://host1:8096/web/modules/pagejs/page.js?v=4.8.0.66:1
    start http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    promise callback*appRouter.start http://host1:8096/web/modules/approuter.js?v=4.8.0.66:1
    onAppReady http://host1:8096/web/app.js?v=4.8.0.66:1
    promise callback*onAppReady http://host1:8096/web/app.js?v=4.8.0.66:1
    promise callback*start http://host1:8096/web/app.js?v=4.8.0.66:1
    <anonymous> http://host1:8096/web/app.js?v=4.8.0.66:1
    <anonymous> http://host1:8096/web/app.js?v=4.8.0.66:1
smoothscroller.js:1:11126

edit:
i also tried brave and edge and both give similar looking result, didnt check the console

 

Link to comment
Share on other sites

TZTZoro

wait, i got a different result @VicMoore
 

apiclient stopping message listener ScheduledTasksInfo apiclient.js:1:19501
Sending web socket message: ScheduledTasksInfoStop apiclient.js:1:18797
====== params =  
Object { name: "pseudotvconfig" }
configurationpage:3070:17
++++++++++ tuner host configuration =  
Object { Type: "pseudotvtuner", ImportFavoritesOnly: false, PreferEpgChannelImages: true, PreferEpgChannelNumbers: false, AllowHWTranscoding: true, AllowMappingByNumber: true, TunerCount: 0, ProviderOptions: "{}", DataVersion: 0 }
configurationpage:2888:21
++++++++++ ProviderOptions =  
Object {  }
configurationpage:2899:17
=== User id =  386464fde02c4ef2b8600eed9fca828b configurationpage:2838:17
=== Server info =  
Object { ManualAddress: "http://host1:8096", ManualAddressOnly: true, IsLocalServer: true, DateLastAccessed: 1704672385019, LastConnectionMode: 2, Type: "Server", Name: "Pieter2", Id: "b205f5ba1d97485790f1f3853f4a3771", UserId: "386464fde02c4ef2b8600eed9fca828b", AccessToken: null, … }
configurationpage:2840:17
=== Current User Name =  TZTZoro configurationpage:2842:17
=== accessToken =  null configurationpage:2845:17
===== currentViews =  
Array(6) [ {…}, {…}, {…}, {…}, {…}, {…} ]
configurationpage:2852:17
================================= configurationpage:2759:17
>>>> Get Live Channels configurationpage:2760:17
>>>> live channels =  
Array(5) [ {…}, {…}, {…}, {…}, {…} ]
configurationpage:2767:17
>>>>> providerOptions =  
Object {  }

 

Edited by TZTZoro
Link to comment
Share on other sites

VicMoore

what did the screen look like? 

Link to comment
Share on other sites

TZTZoro

Empty, and the html is also empty

<div id="masterContainer">
        <div id="helpNode" class="helpNode">
        </div>
        <div id="titleNode" class="titleNode">
        </div>
        <div id="buttonNode" class="buttonNode">
        </div>
        <div class="scrollDiv">
            <div id="pageNode" class="pageNode">
            </div>
        </div>
        <div id="modalNode" class="modalNode">
        </div>
    </div>

image.png.6fe951d3c2ac68be8d29afbabde6fa93.png

Link to comment
Share on other sites

VicMoore

OK - I see whats happening - I am going to change one line of code and the program should come up OK

Vic

Link to comment
Share on other sites

TZTZoro

i get an ui,
the first time i could do stuff but it didnt seem like it saved anything, the selecting content did not work like movies and tvshows

after a server reboot the first UI shows without content and channels and the buttons dont do anything

image.thumb.png.d79562a6869b6b886f6572acd595d455.png

  • Thanks 1
Link to comment
Share on other sites

VicMoore

we are making progress - I have to help my wife for a bit.  I will write you a response in 1 hour.  thanks so much for your help.

vic

Link to comment
Share on other sites

mickle026

sorry for not replying sooner - busy day

The solution  I posted was for the page caching 3 times as an emby gui quirk - that code I posted solves that

The uncaught promise is something is either not returned from your api, or there is an error in the information returned or is isnt parsed correctly, ie received into the js properly.
ie, a function call to the api or c# code - either fails or fails to return properly

I will install this plugin and see if I can help

 

Link to comment
Share on other sites

VicMoore
Posted (edited)

@mickle026The latest code is attached belowPseudoTV.zip

With help from @TZTZoroI may have the problem solved. I followed your proposal and isolated all of the DOM nodes where I attach code with the JS and created references to those nodes using "view.querySelector" rather than "Document.getElementById" and the problem went away. I may still have a problem. I will find out tomorrow when more testing can be done. I would greatly appreciate you looking at the code.  @mickle026you have taught me so much today. Thank you very much.

Vic

PseudoTV.dll

Edited by VicMoore
Link to comment
Share on other sites

VicMoore

@TZTZoroI fixed the problem you pointed out in your last post.  I hope everything works OK now.  You have made a real contribution to this project. Thank you very much.

Vic

Link to comment
Share on other sites

mickle026
7 minutes ago, VicMoore said:

@mickle026The latest code is attached belowPseudoTV.zip

With help from @TZTZoroI may have the problem solved. I isolated all of the DOM nodes where I attach code with the JS and created references to those nodes using "view.querySelector" rather than "Document.getElementById" and the problem went away. I may still have a problem. I will find out tomorrow when more testing can be done. I would greatly appreciate you looking at the code.  @mickle026you have taught me so much today. Thank you very much.

Vic

PseudoTV.dll 204.5 kB · 0 downloads

Thanks @VicMoore

I will look at the code as soon as  I have time.  Pretty swamped this week though.  So not really any idea when it will be.
 

  • Thanks 1
Link to comment
Share on other sites

TZTZoro
7 hours ago, VicMoore said:

@mickle026The latest code is attached belowPseudoTV.zip

With help from @TZTZoroI may have the problem solved. I followed your proposal and isolated all of the DOM nodes where I attach code with the JS and created references to those nodes using "view.querySelector" rather than "Document.getElementById" and the problem went away. I may still have a problem. I will find out tomorrow when more testing can be done. I would greatly appreciate you looking at the code.  @mickle026you have taught me so much today. Thank you very much.

Vic

PseudoTV.dll 204.5 kB · 1 download

Using this version the UI looks like this
image.png.ed8a9560d273adb075834f1b2a56bbc9.png
image.png.f894e94cc6f92ab6efb7788f62a2a8c8.png

Only the first channel button works in the first image, all the other buttons do not work(i only didnt try to update the epg), the other 5 channels are from a different source i think but they do have logos

  • Thanks 1
Link to comment
Share on other sites

kjhedges

@VicMoore

I see progress has been made.

I created a single channel and this populated as it should do. I was able to view the Live TV Channel I created and the EPG was complete too.

I was not able to edit the current channel I created though once it was created.

I also presume that the settings and help buttons are currently not active

Untitled.png

  • Thanks 1
Link to comment
Share on other sites

VicMoore

@TZTZoroand @kjhedgesthanks so much for the testing. Yes, we are making progress.  Please copy me the browser console when the plugin stops working.  I want to see the error message.

Vic

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...