How to change the appearance of the Player?

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
sphere
Posts: 477
Joined: Sat Sep 27, 2014 10:32 am
Location: the Netherlands

How to change the appearance of the Player?

Post by sphere » Sat Nov 26, 2016 1:53 pm

Hello,

does anyone knows how to change the appearance of the player?
And i don't mean just the colors you can set in the inspector.

I mean the knobs and all such.

thanks a lot for any help on this.

Sphere
Global Market Share WorldWide Android 84.82%
Global Market Share WorldWide iOs 12%

Just a wild guess that we need more support and features for Android than iOs...

shaosean
Posts: 878
Joined: Thu Nov 04, 2010 7:53 am

Re: How to change the appearance of the Player?

Post by shaosean » Sat Nov 26, 2016 2:58 pm

I think you would have to hide the built-in controls (can they be hidden?) and then create your own controls to manipulate the properties of the player..

sphere
Posts: 477
Joined: Sat Sep 27, 2014 10:32 am
Location: the Netherlands

Re: How to change the appearance of the Player?

Post by sphere » Sat Nov 26, 2016 7:35 pm

Ah yes that's an idea too.
Just hide the complete player.

but when you still want to see the progress bar then another issue rises, i believe.
I think all together it would be easier to have access to the graphics.
Global Market Share WorldWide Android 84.82%
Global Market Share WorldWide iOs 12%

Just a wild guess that we need more support and features for Android than iOs...

shaosean
Posts: 878
Joined: Thu Nov 04, 2010 7:53 am

Re: How to change the appearance of the Player?

Post by shaosean » Sun Nov 27, 2016 2:15 am

Another option would be to play the video through a web widget and you can use JS and CSS to style the HTML player <http://mrbool.com/how-to-style-the-html ... -css/27683>

sphere
Posts: 477
Joined: Sat Sep 27, 2014 10:32 am
Location: the Netherlands

Re: How to change the appearance of the Player?

Post by sphere » Sun Nov 27, 2016 2:01 pm

Very nice thank you.
Maybe it can be of help indeed.

Did you see the new Google Web Designer? a complete HTML5 web designingtool, still Beta.
Unfortunately is refusing to import HTML5 files not created with the tool. I tried to import the exported one by LC just to test.

Did not play with it much yet.
Global Market Share WorldWide Android 84.82%
Global Market Share WorldWide iOs 12%

Just a wild guess that we need more support and features for Android than iOs...

okk
Posts: 69
Joined: Wed Feb 04, 2015 11:37 am

Re: How to change the appearance of the Player?

Post by okk » Sat Jan 21, 2017 10:12 pm

sphere wrote: but when you still want to see the progress bar then another issue rises, i believe.
I think all together it would be easier to have access to the graphics.
I think your best option is to hide the controller and create one by yourself. The progress-bar can be easily re-created with your own code for example by setting the width of a line based on the currenttime of the player. See my code example. This script is located in the playerobject. It draws a line indicating how much of the moviefile has already been played. You have to call the script when the player is started.

Code: Select all

on updateprogress
   put the duration of me into movielength
   put the currenttime of me into movieprogress
   set the points of graphic "movieprogress" to (the left of me), the bottom of me+1,  (the left of me) + (round(movieprogress/movielength*(the width of me))),  the bottom of me+1
   if movielength > (movieprogress +5) then
      send updateprogress to me in 10 milliseconds
   else
      hide graphic "movieprogress"
      hide player "cinema"
          
      -- kill progressbar
      put the pendingmessages into pendingmsg
      if "updateprogress" is in pendingmsg then
         repeat FOR each line x in pendingmsg
            if "updateprogress" is in x THEN cancel item 1 of x
         end REPEAT
      end if
   end if
end updateprogress

sphere
Posts: 477
Joined: Sat Sep 27, 2014 10:32 am
Location: the Netherlands

Re: How to change the appearance of the Player?

Post by sphere » Sun Jan 22, 2017 10:04 am

Thank you very much.
Going to have a play with it :D
Global Market Share WorldWide Android 84.82%
Global Market Share WorldWide iOs 12%

Just a wild guess that we need more support and features for Android than iOs...

Klaus
Posts: 9619
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to change the appearance of the Player?

Post by Klaus » Mon Jan 23, 2017 5:28 pm

Hi all,

use a local variable to avoid messing around with ALL pending messages:

Code: Select all

local tPendingUpdateProgress

on updateprogress
   put the duration of me into movielength
   put the currenttime of me into movieprogress
   set the points of graphic "movieprogress" to (the left of me), the bottom of me+1,  \
                  (the left of me) + (round(movieprogress/movielength*(the width of me))),  the bottom of me+1
   if movielength > (movieprogress +5) then
      send "updateprogress" to me in 10 milliseconds
      ## !!!
      put the result into tPendingUpdateProgress
     ### !!!
   else
      hide graphic "movieprogress"
      hide player "cinema"

     ## !!! Kill progressbar in a ONE liner:
     cancel tPendingUpdateProgress
    ## !!!
   end if
end updateprogress
Best

Klaus

okk
Posts: 69
Joined: Wed Feb 04, 2015 11:37 am

Re: How to change the appearance of the Player?

Post by okk » Wed Jan 25, 2017 12:33 pm

Thanks Klaus, always learning something new here. I learned the kill pending message loop here on the forum, but your solution with a local variable is so much more smart. Thank you! Oliver

sphere
Posts: 477
Joined: Sat Sep 27, 2014 10:32 am
Location: the Netherlands

Re: How to change the appearance of the Player?

Post by sphere » Wed Mar 15, 2017 8:04 pm

Thanks for your script OKK and your addition Klaus.

Ciao!
Global Market Share WorldWide Android 84.82%
Global Market Share WorldWide iOs 12%

Just a wild guess that we need more support and features for Android than iOs...

Post Reply

Return to “Rich Media”