Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1049 Lượt xem

Hello Odoo Community.


I patch fullscreen player in order to show sharepoint url into new videoplayer. 

this is working fine but If I select any other slide which is youtube, vimeo, or image or article it is not rendering. 


I want if is_sharepoint == true then render my videoplayer else render as normal functionality don't change anything. 

when I'm updating render function it broke normal functionality. 


how to do this. 



Thank you. 



/** @odoo-module **/


console.log('custom_fullscreen_player_v2.js ....');


import publicWidget from '@web/legacy/js/public/public_widget';

import { patch } from "@web/core/utils/patch";

import Fullscreen from '@website_slides/js/slides_course_fullscreen_player';  // Correct path to Fullscreen widget

import { renderToElement } from "@web/core/utils/render";

import { unhideConditionalElements } from '@website/js/content/inject_dom';




var VideoPlayerSharePoint = publicWidget.Widget.extend({

   // this is my videoplayer for sharepoint. different video player....

});





// Patching the Fullscreen widget (slides_course_fullscreen_player.js)

patch(Fullscreen.prototype, {

   

    setup() {

       

        this._super.apply(...arguments);

    },


 

    // WHEN WE ADD CUSTOM RENDER SYSTEM IS BROKEN..................

    _renderSlide: async function () {


        // Avoid concurrent execution of the slide rendering as it writes the content at the same place anyway.

        if (this._renderSlideRunning) { return; }

        this._renderSlideRunning = true;

        try {

            var slide = this.get('slide');

            var $content = this.$('.o_wslides_fs_content');

            $content.empty();

            if (this.websiteAnimateWidget) {

                this.websiteAnimateWidget.destroy()

                this.websiteAnimateWidget = null;

            }


            // fetch data from database.


               

            })

            .catch(error => {

                console.error('Error fetching slide data:', error);

            });




            // render slide content

            if (slide?.is_sharepoint) {

                console.log('Rendering SharePoint video player for the slide:', slide);


                // Render the custom SharePoint video player

                const player = new VideoPlayerSharePoint(this, slide);

                await player.appendTo(this.$('.o_wslides_fs_content'));

               

                // this part is ok. no problem.....

            } else {

                console.log('no sharepoint lesson content...');


               

                // I WANT IF IT IS NOT SHAREPOINT IT SHOULD CONTINUE TO RENDER ORIGINAL FULLSCREEN PLAYER WHICH IS (slide_course_fullscreen_player )


               


            }

        } catch(e){

            console.log('custom render error : ', e);

        }

        finally {

            this._renderSlideRunning = false;

        }




   

    }



});


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 24
2225
1
thg 7 24
6867
2
thg 4 25
1973
1
thg 1 25
1658
1
thg 9 24
2313